Commit: c3fa0adcbea4a2c701c63ae50bbf4ac4ab45c324
Author: Antonio Vazquez
Date:   Tue Jun 13 16:41:08 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rBc3fa0adcbea4a2c701c63ae50bbf4ac4ab45c324

Cleanup: Remove unused variable

Remove mode for cache_dirty

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

M       source/blender/blenkernel/BKE_gpencil.h
M       source/blender/blenkernel/intern/gpencil.c
M       source/blender/blenloader/intern/versioning_280.c
M       source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
M       source/blender/draw/engines/gpencil/gpencil_engine.h
M       source/blender/draw/engines/gpencil/gpencil_geom.c
M       source/blender/draw/intern/draw_cache_impl.h
M       source/blender/editors/gpencil/gpencil_data.c
M       source/blender/editors/gpencil/gpencil_edit.c
M       source/blender/editors/gpencil/gpencil_interpolate.c
M       source/blender/editors/gpencil/gpencil_paint.c
M       source/blender/makesrna/intern/rna_gpencil.c

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

diff --git a/source/blender/blenkernel/BKE_gpencil.h 
b/source/blender/blenkernel/BKE_gpencil.h
index 1d9feb2d85a..fee144dfee5 100644
--- a/source/blender/blenkernel/BKE_gpencil.h
+++ b/source/blender/blenkernel/BKE_gpencil.h
@@ -52,7 +52,7 @@ void BKE_gpencil_free_brushes(struct ListBase *list);
 void BKE_gpencil_free_palettes(struct ListBase *list);
 void BKE_gpencil_free(struct bGPdata *gpd, bool free_all);
 
-void BKE_gpencil_batch_cache_dirty(struct bGPdata *gpd, int mode);
+void BKE_gpencil_batch_cache_dirty(struct bGPdata *gpd);
 void BKE_gpencil_batch_cache_free(struct bGPdata *gpd);
 void BKE_gpencil_batch_cache_alldirty(void);
 
diff --git a/source/blender/blenkernel/intern/gpencil.c 
b/source/blender/blenkernel/intern/gpencil.c
index cd03a9f0106..d9ca4466b43 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -57,13 +57,13 @@
 #include "BKE_main.h"
 
  /* Draw Engine */
-void(*BKE_gpencil_batch_cache_dirty_cb)(bGPdata *gpd, int mode) = NULL;
+void(*BKE_gpencil_batch_cache_dirty_cb)(bGPdata *gpd) = NULL;
 void(*BKE_gpencil_batch_cache_free_cb)(bGPdata *gpd) = NULL;
 
-void BKE_gpencil_batch_cache_dirty(bGPdata *gpd, int mode)
+void BKE_gpencil_batch_cache_dirty(bGPdata *gpd)
 {
        if (gpd->batch_cache) {
-               BKE_gpencil_batch_cache_dirty_cb(gpd, mode);
+               BKE_gpencil_batch_cache_dirty_cb(gpd);
        }
 }
 
@@ -1447,7 +1447,7 @@ void BKE_gpencil_batch_cache_alldirty()
        Main *bmain = G.main;
 
        for (gpd = bmain->gpencil.first; gpd; gpd = gpd->id.next) {
-               BKE_gpencil_batch_cache_dirty(gpd, 0);
+               BKE_gpencil_batch_cache_dirty(gpd);
        }
 }
 
diff --git a/source/blender/blenloader/intern/versioning_280.c 
b/source/blender/blenloader/intern/versioning_280.c
index 3b1effb0481..2ef1e5cb292 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -323,7 +323,7 @@ void do_versions_after_linking_280(Main *main)
                                scene->gpd = NULL;
 
                                /* set cache as dirty */
-                               BKE_gpencil_batch_cache_dirty(ob->gpd, 0);
+                               BKE_gpencil_batch_cache_dirty(ob->gpd);
                        }
                        /* set default mode as object */
                        scene->toolsettings->gpencil_src = 
GP_TOOL_SOURCE_OBJECT;
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 14ef2fde794..29a6d73a330 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -459,8 +459,6 @@ static void gpencil_draw_strokes(GpencilBatchCache *cache, 
GPENCIL_e_data *e_dat
 {
        GPENCIL_PassList *psl = ((GPENCIL_Data *)vedata)->psl;
        GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl;
-       const DRWContextState *draw_ctx = DRW_context_state_get();
-       RegionView3D *rv3d = draw_ctx->rv3d;
 
        DRWShadingGroup *fillgrp;
        DRWShadingGroup *strokegrp;
@@ -472,7 +470,7 @@ static void gpencil_draw_strokes(GpencilBatchCache *cache, 
GPENCIL_e_data *e_dat
 
        for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
                /* check if stroke can be drawn */
-               if (gpencil_can_draw_stroke(rv3d, gpf, gps, onion) == false) {
+               if (gpencil_can_draw_stroke(gps, onion) == false) {
                        continue;
                }
                /* limit the number of shading groups */
@@ -657,7 +655,7 @@ void DRW_gpencil_populate_datablock(GPENCIL_e_data *e_data, 
void *vedata, Scene
        cache->is_dirty = false;
 }
 
-void DRW_gpencil_batch_cache_dirty(bGPdata *gpd, int UNUSED(mode))
+void DRW_gpencil_batch_cache_dirty(bGPdata *gpd)
 {
        GpencilBatchCache *cache = gpd->batch_cache;
        if (cache == NULL) {
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h 
b/source/blender/draw/engines/gpencil/gpencil_engine.h
index c150a48f778..a4a9de99cec 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.h
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.h
@@ -149,7 +149,7 @@ struct Batch *DRW_gpencil_get_buffer_point_geom(struct 
bGPdata *gpd, short thick
 
 void gpencil_batch_cache_clear(struct bGPdata *gpd);
 
-bool gpencil_can_draw_stroke(struct RegionView3D *rv3d, const struct bGPDframe 
*gpf, const struct bGPDstroke *gps, const bool onion);
+bool gpencil_can_draw_stroke(const struct bGPDstroke *gps, const bool onion);
 
 struct tGPencilObjectCache *gpencil_object_cache_allocate(struct 
tGPencilObjectCache *cache, int *gp_cache_size, int *gp_cache_used);
 void gpencil_object_cache_add(struct tGPencilObjectCache *cache, struct 
RegionView3D *rv3d, struct Object *ob, int *gp_cache_used);
diff --git a/source/blender/draw/engines/gpencil/gpencil_geom.c 
b/source/blender/draw/engines/gpencil/gpencil_geom.c
index 03451349c6d..1eb068f9c7b 100644
--- a/source/blender/draw/engines/gpencil/gpencil_geom.c
+++ b/source/blender/draw/engines/gpencil/gpencil_geom.c
@@ -365,7 +365,7 @@ Batch *DRW_gpencil_get_buffer_fill_geom(const tGPspoint 
*points, int totpoints,
 
 
 /* Helper for doing all the checks on whether a stroke can be drawn */
-bool gpencil_can_draw_stroke(RegionView3D *UNUSED(rv3d), const bGPDframe 
*UNUSED(gpf), const bGPDstroke *gps, const bool onion)
+bool gpencil_can_draw_stroke(const bGPDstroke *gps, const bool onion)
 {
        /* skip stroke if it doesn't have any valid data */
        if ((gps->points == NULL) || (gps->totpoints < 1))
@@ -380,25 +380,6 @@ bool gpencil_can_draw_stroke(RegionView3D *UNUSED(rv3d), 
const bGPDframe *UNUSED
                return false;
        }
 
-#if 0
-       /* Check if stroke is in view plane, not on camera back. Only check 
first point of 
-          the stroke because check all points is too work and it works fine in 
most situations
-       */
-       float viewfpt[3];
-       mul_v3_m4v3(viewfpt, gpf->viewmatrix, &gps->points[0].x);
-       float zdepth = 0.0;
-
-       if (rv3d->is_persp) {
-               zdepth = ED_view3d_calc_zfac(rv3d, viewfpt, NULL);
-       }
-       else {
-               zdepth = -dot_v3v3(rv3d->viewinv[2], viewfpt);
-       }
-       if (zdepth < 0.0) {
-               return false;
-       }
-#endif 
-
        /* stroke can be drawn */
        return true;
 }
diff --git a/source/blender/draw/intern/draw_cache_impl.h 
b/source/blender/draw/intern/draw_cache_impl.h
index 8dbeaf6dfea..fb343b57c7e 100644
--- a/source/blender/draw/intern/draw_cache_impl.h
+++ b/source/blender/draw/intern/draw_cache_impl.h
@@ -49,7 +49,7 @@ void DRW_lattice_batch_cache_free(struct Lattice *lt);
 void DRW_particle_batch_cache_dirty(struct ParticleSystem *psys, int mode);
 void DRW_particle_batch_cache_free(struct ParticleSystem *psys);
 
-void DRW_gpencil_batch_cache_dirty(struct bGPdata *gpd, int mode);
+void DRW_gpencil_batch_cache_dirty(struct bGPdata *gpd);
 void DRW_gpencil_batch_cache_free(struct bGPdata *gpd);
 
 /* Curve */
diff --git a/source/blender/editors/gpencil/gpencil_data.c 
b/source/blender/editors/gpencil/gpencil_data.c
index f76cd7b1385..e2b0bc42c79 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -259,7 +259,7 @@ static int gp_layer_remove_exec(bContext *C, wmOperator *op)
        BKE_gpencil_layer_delete(gpd, gpl);
        
        /* notifiers */
-       BKE_gpencil_batch_cache_dirty(gpd, 0);
+       BKE_gpencil_batch_cache_dirty(gpd);
        WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
        
        return OPERATOR_FINISHED;
@@ -299,7 +299,7 @@ static int gp_layer_move_exec(bContext *C, wmOperator *op)
        
        BLI_assert(ELEM(direction, -1, 0, 1)); /* we use value below */
        if (BLI_listbase_link_move(&gpd->layers, gpl, direction)) {
-               BKE_gpencil_batch_cache_dirty(gpd, 0);
+               BKE_gpencil_batch_cache_dirty(gpd);
                WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, 
NULL);
        }
        
@@ -350,7 +350,7 @@ static int gp_layer_copy_exec(bContext *C, wmOperator 
*UNUSED(op))
        BKE_gpencil_layer_setactive(gpd, new_layer);
        
        /* notifiers */
-       BKE_gpencil_batch_cache_dirty(gpd, 0);
+       BKE_gpencil_batch_cache_dirty(gpd);
        WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
        
        return OPERATOR_FINISHED;
@@ -399,7 +399,7 @@ static int gp_hide_exec(bContext *C, wmOperator *op)
        }
        
        /* notifiers */
-       BKE_gpencil_batch_cache_dirty(gpd, 0);
+       BKE_gpencil_batch_cache_dirty(gpd);
        WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
        
        return OPERATOR_FINISHED;
@@ -446,7 +446,7 @@ static int gp_reveal_exec(bContext *C, wmOperator 
*UNUSED(op))
        }
        
        /* notifiers */
-       BKE_gpencil_batch_cache_dirty(gpd, 0);
+       BKE_gpencil_batch_cache_dirty(gpd);
        WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
        
        return OPERATOR_FINISHED;
@@ -484,7 +484,7 @@ static int gp_lock_all_exec(bContext *C, wmOperator 
*UNUSED(op))
        }
        
        /* notifiers */
-       BKE_gpencil_batch_cache_dirty(gpd, 0);
+       BKE_gpencil_batch_cache_dirty(gpd);
        WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
        
        return OPERATOR_FINISHED;
@@ -522,7 +522,7 @@ static int gp_unlock_all_exec(bContext *C, wmOperator 
*UNUSED(op))
        }
        
        /* notifiers */
-       BKE_gpencil_batch_cache_dirty(gpd, 0);
+       BKE_gpencil_batch_cache_dirty(gpd);
        WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
        
        return OPERATOR_FINISHED;
@@ -595,7 +595,7 @@ static int gp_isolate_layer_exec(bContext *C, wmOperator 
*op)
        }
        
        /* notifiers */
-       BKE_gpencil_batch_cache_dirty(gpd, 0);
+       BKE_gpencil_batch_cache_dirty(gpd);
        WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
        
        return OPERATOR_FINISHED;
@@ -655,7 +655,7 @@ static int gp_merge_layer_exec(bContext *C, wmOperator *op)
        BLI_ghash_free(gh_frames_cur, NULL, NULL);
 
        /* notifiers */
-       BKE_gpencil_batch_cache_dirty(gpd, 0);
+       BKE_gpencil_batch_cache_dirty(gpd);
        WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
 
        return OPERATOR_FINISHED;
@@ -717,7 +717,7 @@ static int gp_layer_change_exec(bContext *C, wmOperator *op)
        BKE_gpencil_layer_setactive(gpd, gpl);
        
        /* updates */
-       BKE_gpencil_batch_cache_dirty(gpd, 0);
+       BKE_gpencil_batch_cache_dirty(gpd);
        WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
        
        return OPERATOR_FINISHED;
@@ -838,7 +838,7 @@ static int gp_stroke_arrange_exec(bContext *C, wmOperator 
*op)
        BLI_freelistN(&selected);
 
        /* notifiers */
-       BKE_gpencil_batch_cache_dirty(gpd, 0);
+       BKE_gpencil_batch_cache_dirty(gpd);
        WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
 
        retu

@@ Diff output truncated at 10240 characters. @@

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

Reply via email to