Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonioya <blendergit@gmail.com>2019-07-06 00:11:53 +0300
committerAntonioya <blendergit@gmail.com>2019-07-06 00:52:26 +0300
commita0f3ea7da3f65333fbac9c2d528c4242c417860d (patch)
treed6004f828aba6d51eb1ace911f8d8be7c0fdea96 /source/blender/draw/engines/gpencil
parenta7a9c0e50dc9b96d84e1e7cf18d26b3ef5679aa5 (diff)
Fix T62101: GPencil: selection order is wrong
Following the advices of @Germano Cavalcante (mano-wii) , I have exposed as a workaround the free function to be called from draw manager for selection. Now, the free function is not called for selection inside gpencil draw_scene, but it's called from draw_manager.c. The real fix would be create a new Scene_finish callback in draw manager, but as the release of 2.80 is almost here, we fix this with a workaround that must be removed when new callback is in place. Differential Revision: http://developer.blender.org/D5193
Diffstat (limited to 'source/blender/draw/engines/gpencil')
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_engine.c11
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_engine.h16
2 files changed, 16 insertions, 11 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index e5dadba9bdc..5d7ec490fb6 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -771,8 +771,11 @@ static void gpencil_prepare_fast_drawing(GPENCIL_StorageList *stl,
}
}
-static void gpencil_free_runtime_data(GPENCIL_StorageList *stl)
+void DRW_gpencil_free_runtime_data(void *ved)
{
+ GPENCIL_Data *vedata = (GPENCIL_Data *)ved;
+ GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl;
+
/* free gpu data */
DRW_TEXTURE_FREE_SAFE(stl->g_data->gpencil_blank_texture);
@@ -976,8 +979,6 @@ void GPENCIL_draw_scene(void *ved)
/* if the draw is for select, do a basic drawing and return */
if (DRW_state_is_select() || DRW_state_is_depth()) {
drw_gpencil_select_render(stl, psl);
- /* free memory */
- gpencil_free_runtime_data(stl);
return;
}
@@ -1010,7 +1011,7 @@ void GPENCIL_draw_scene(void *ved)
}
/* free memory */
- gpencil_free_runtime_data(stl);
+ DRW_gpencil_free_runtime_data(ved);
return;
}
@@ -1159,7 +1160,7 @@ void GPENCIL_draw_scene(void *ved)
}
}
/* free memory */
- gpencil_free_runtime_data(stl);
+ DRW_gpencil_free_runtime_data(ved);
/* reset */
if (DRW_state_is_fbo()) {
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h b/source/blender/draw/engines/gpencil/gpencil_engine.h
index d84bdfd8f2c..bc83136fece 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.h
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.h
@@ -359,12 +359,12 @@ typedef struct GpencilBatchCacheElem {
} GpencilBatchCacheElem;
typedef struct GpencilBatchGroup {
- bGPDlayer *gpl; /* reference to original layer */
- bGPDframe *gpf; /* reference to original frame */
- bGPDstroke *gps; /* reference to original stroke */
- short type; /* type of element */
- bool onion; /* the group is part of onion skin */
- int vertex_idx; /* index of vertex data */
+ struct bGPDlayer *gpl; /* reference to original layer */
+ struct bGPDframe *gpf; /* reference to original frame */
+ struct bGPDstroke *gps; /* reference to original stroke */
+ short type; /* type of element */
+ bool onion; /* the group is part of onion skin */
+ int vertex_idx; /* index of vertex data */
} GpencilBatchGroup;
typedef enum GpencilBatchGroup_Type {
@@ -507,6 +507,10 @@ void GPENCIL_render_to_image(void *vedata,
struct RenderLayer *render_layer,
const rcti *rect);
+/* TODO: GPXX workaround function to call free memory from draw manager while draw manager support
+ * scene finish callback. */
+void DRW_gpencil_free_runtime_data(void *ved);
+
/* Use of multisample framebuffers. */
#define MULTISAMPLE_GP_SYNC_ENABLE(lvl, fbl) \
{ \