Commit: 239e8f3ae4999cadc70a5b5071ec73b28d0b32f2
Author: Antonio Vazquez
Date:   Tue May 16 12:22:02 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB239e8f3ae4999cadc70a5b5071ec73b28d0b32f2

Remove flag fields to control buffer stroke creation

These fields are not necessary now.

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

M       source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
M       source/blender/draw/engines/gpencil/gpencil_engine.h

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

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c 
b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
index 75daba2131b..158cb56fc6f 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -145,12 +145,8 @@ void gpencil_batch_cache_clear(bGPdata *gpd)
                MEM_SAFE_FREE(cache->batch_edit);
        }
 
-       if (cache->is_buffer_stroke) {
-               BATCH_DISCARD_ALL_SAFE(cache->batch_buffer_stroke);
-       }
-       if (cache->is_buffer_fill) {
-               BATCH_DISCARD_ALL_SAFE(cache->batch_buffer_fill);
-       }
+       BATCH_DISCARD_ALL_SAFE(cache->batch_buffer_stroke);
+       BATCH_DISCARD_ALL_SAFE(cache->batch_buffer_fill);
 }
 
 /* get cache */
@@ -445,13 +441,11 @@ static void gpencil_draw_buffer_strokes(GpencilBatchCache 
*cache, void *vedata,
                        short lthick = brush->thickness;
                        if (gpd->sbuffer_size == 1) {
                                cache->batch_buffer_stroke = 
gpencil_get_buffer_point_geom(gpd, lthick);
-                               cache->is_buffer_stroke = true;
                                
DRW_shgroup_call_add(stl->g_data->shgrps_point_volumetric, 
cache->batch_buffer_stroke, stl->storage->unit_matrix);
                        }
                        else {
                                /* use unit matrix because the buffer is in 
screen space and does not need conversion */
                                cache->batch_buffer_stroke = 
gpencil_get_buffer_stroke_geom(gpd, stl->storage->unit_matrix, lthick);
-                               cache->is_buffer_stroke = true;
                                
DRW_shgroup_call_add(stl->g_data->shgrps_drawing_stroke, 
cache->batch_buffer_stroke, stl->storage->unit_matrix);
 
                                if ((gpd->sbuffer_size >= 3) && ((gpd->sfill[3] 
> GPENCIL_ALPHA_OPACITY_THRESH) || (gpd->bfill_style > 0))) {
@@ -460,7 +454,6 @@ static void gpencil_draw_buffer_strokes(GpencilBatchCache 
*cache, void *vedata,
                                                gpd->sfill[3] = 0.5f;
                                        }
                                        cache->batch_buffer_fill = 
gpencil_get_buffer_fill_geom(gpd->sbuffer, gpd->sbuffer_size, gpd->sfill);
-                                       cache->is_buffer_fill = true;
                                        
DRW_shgroup_call_add(stl->g_data->shgrps_drawing_fill, 
cache->batch_buffer_fill, stl->storage->unit_matrix);
                                }
                        }
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h 
b/source/blender/draw/engines/gpencil/gpencil_engine.h
index 48659c10749..e3a6773d8ab 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.h
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.h
@@ -107,8 +107,6 @@ typedef struct GpencilBatchCache {
        /* for buffer only one batch is nedeed because the drawing is only of 
one stroke */
        Batch *batch_buffer_stroke;
        Batch *batch_buffer_fill;
-       bool is_buffer_stroke;
-       bool is_buffer_fill;
 
        /* settings to determine if cache is invalid */
        bool is_dirty;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to