GP: Use original datablock and not evaluated version

This is required to avoid COW delay while drawing.
This commit is contained in:
Antonioya
2018-09-11 10:29:33 +02:00
parent 65c5abc236
commit 43abc5dabf

View File

@@ -42,6 +42,8 @@
#include "gpencil_engine.h"
#include "DEG_depsgraph_query.h"
#include "ED_screen.h"
#include "ED_gpencil.h"
@@ -381,9 +383,11 @@ void GPENCIL_cache_init(void *vedata)
(obact_gpd->flag & GP_DATA_STROKE_PAINTMODE) &&
(stl->storage->is_playing == false))
{
if (((obact_gpd->runtime.sbuffer_sflag & GP_STROKE_ERASER) == 0) &&
(obact_gpd->runtime.sbuffer_size > 0) &&
((obact_gpd->flag & GP_DATA_STROKE_POLYGON) == 0))
/* need the original to avoid cow overhead while drawing */
bGPdata *gpd_orig = (bGPdata *)DEG_get_original_id(&obact_gpd->id);
if (((gpd_orig->runtime.sbuffer_sflag & GP_STROKE_ERASER) == 0) &&
(gpd_orig->runtime.sbuffer_size > 0) &&
((gpd_orig->flag & GP_DATA_STROKE_POLYGON) == 0))
{
stl->g_data->session_flag |= GP_DRW_PAINT_PAINTING;
}