GPencil: Remove uneeded storage->unit_matrix
authorClément Foucault <foucault.clem@gmail.com>
Wed, 29 May 2019 15:44:16 +0000 (17:44 +0200)
committerClément Foucault <foucault.clem@gmail.com>
Thu, 30 May 2019 11:42:21 +0000 (13:42 +0200)
When passing NULL to DRW_shgroup_call(), ModelMatrix is assumed
to be unitmat.

source/blender/draw/engines/gpencil/gpencil_draw_utils.c
source/blender/draw/engines/gpencil/gpencil_engine.c
source/blender/draw/engines/gpencil/gpencil_engine.h

index 4718985..964b797 100644 (file)
@@ -1549,9 +1549,7 @@ void DRW_gpencil_populate_buffer_strokes(GPENCIL_e_data *e_data,
         }
 
         /* buffer strokes, must show stroke always */
-        DRW_shgroup_call(stl->g_data->shgrps_drawing_stroke,
-                         e_data->batch_buffer_stroke,
-                         stl->storage->unit_matrix);
+        DRW_shgroup_call(stl->g_data->shgrps_drawing_stroke, e_data->batch_buffer_stroke, NULL);
 
         if ((gpd->runtime.sbuffer_size >= 3) &&
             (gpd->runtime.sfill[3] > GPENCIL_ALPHA_OPACITY_THRESH) &&
@@ -1573,9 +1571,7 @@ void DRW_gpencil_populate_buffer_strokes(GPENCIL_e_data *e_data,
           }
 
           e_data->batch_buffer_fill = DRW_gpencil_get_buffer_fill_geom(gpd);
-          DRW_shgroup_call(stl->g_data->shgrps_drawing_fill,
-                           e_data->batch_buffer_fill,
-                           stl->storage->unit_matrix);
+          DRW_shgroup_call(stl->g_data->shgrps_drawing_fill, e_data->batch_buffer_fill, NULL);
           stl->storage->buffer_fill = true;
         }
         stl->storage->buffer_stroke = true;
@@ -1605,7 +1601,7 @@ void DRW_gpencil_populate_buffer_strokes(GPENCIL_e_data *e_data,
 
     e_data->batch_buffer_ctrlpoint = DRW_gpencil_get_buffer_ctrlpoint_geom(gpd);
 
-    DRW_shgroup_call(shgrp, e_data->batch_buffer_ctrlpoint, stl->storage->unit_matrix);
+    DRW_shgroup_call(shgrp, e_data->batch_buffer_ctrlpoint, NULL);
 
     stl->storage->buffer_ctrlpoint = true;
   }
index 6bcffe3..f597797 100644 (file)
@@ -244,9 +244,6 @@ void GPENCIL_engine_init(void *vedata)
   /* init storage */
   if (!stl->storage) {
     stl->storage = MEM_callocN(sizeof(GPENCIL_Storage), "GPENCIL_Storage");
-
-    /* unit matrix */
-    unit_m4(stl->storage->unit_matrix);
     stl->storage->shade_render[0] = OB_RENDER;
     stl->storage->shade_render[1] = 0;
   }
index 6b66f13..aa26d78 100644 (file)
@@ -145,7 +145,6 @@ typedef struct GPENCIL_shgroup {
 
 typedef struct GPENCIL_Storage {
   int shgroup_id; /* total elements */
-  float unit_matrix[4][4];
   int stroke_style;
   int color_type;
   int mode;