Changeset View
Changeset View
Standalone View
Standalone View
source/blender/compositor/intern/COM_compositor.cpp
| Show All 37 Lines | |||||
| static ThreadMutex s_compositorMutex; | static ThreadMutex s_compositorMutex; | ||||
| static bool is_compositorMutex_init = FALSE; | static bool is_compositorMutex_init = FALSE; | ||||
| static void intern_freeCompositorCaches() | static void intern_freeCompositorCaches() | ||||
| { | { | ||||
| deintializeDistortionCache(); | deintializeDistortionCache(); | ||||
| } | } | ||||
| void COM_execute(RenderData *rd, bNodeTree *editingtree, int rendering, | void COM_execute(RenderData *rd, Scene *scene, bNodeTree *editingtree, int rendering, | ||||
| const ColorManagedViewSettings *viewSettings, | const ColorManagedViewSettings *viewSettings, | ||||
| const ColorManagedDisplaySettings *displaySettings) | const ColorManagedDisplaySettings *displaySettings) | ||||
| { | { | ||||
| /* initialize mutex, TODO this mutex init is actually not thread safe and | /* initialize mutex, TODO this mutex init is actually not thread safe and | ||||
| * should be done somewhere as part of blender startup, all the other | * should be done somewhere as part of blender startup, all the other | ||||
| * initializations can be done lazily */ | * initializations can be done lazily */ | ||||
| if (is_compositorMutex_init == FALSE) { | if (is_compositorMutex_init == FALSE) { | ||||
| BLI_mutex_init(&s_compositorMutex); | BLI_mutex_init(&s_compositorMutex); | ||||
| Show All 21 Lines | void COM_execute(RenderData *rd, Scene *scene, bNodeTree *editingtree, int rendering, | ||||
| WorkScheduler::initialize(use_opencl, BKE_render_num_threads(rd)); | WorkScheduler::initialize(use_opencl, BKE_render_num_threads(rd)); | ||||
| /* set progress bar to 0% and status to init compositing */ | /* set progress bar to 0% and status to init compositing */ | ||||
| editingtree->progress(editingtree->prh, 0.0); | editingtree->progress(editingtree->prh, 0.0); | ||||
| bool twopass = (editingtree->flag & NTREE_TWO_PASS) > 0 && !rendering; | bool twopass = (editingtree->flag & NTREE_TWO_PASS) > 0 && !rendering; | ||||
| /* initialize execution system */ | /* initialize execution system */ | ||||
| if (twopass) { | if (twopass) { | ||||
| ExecutionSystem *system = new ExecutionSystem(rd, editingtree, rendering, twopass, viewSettings, displaySettings); | ExecutionSystem *system = new ExecutionSystem(rd, scene, editingtree, rendering, twopass, viewSettings, displaySettings); | ||||
| system->execute(); | system->execute(); | ||||
| delete system; | delete system; | ||||
| if (editingtree->test_break(editingtree->tbh)) { | if (editingtree->test_break(editingtree->tbh)) { | ||||
| // during editing multiple calls to this method can be triggered. | // during editing multiple calls to this method can be triggered. | ||||
| // make sure one the last one will be doing the work. | // make sure one the last one will be doing the work. | ||||
| BLI_mutex_unlock(&s_compositorMutex); | BLI_mutex_unlock(&s_compositorMutex); | ||||
| return; | return; | ||||
| } | } | ||||
| } | } | ||||
| ExecutionSystem *system = new ExecutionSystem(rd, editingtree, rendering, false, | ExecutionSystem *system = new ExecutionSystem(rd, scene, editingtree, rendering, false, | ||||
| viewSettings, displaySettings); | viewSettings, displaySettings); | ||||
| system->execute(); | system->execute(); | ||||
| delete system; | delete system; | ||||
| BLI_mutex_unlock(&s_compositorMutex); | BLI_mutex_unlock(&s_compositorMutex); | ||||
| } | } | ||||
| static void UNUSED_FUNCTION(COM_freeCaches)() | static void UNUSED_FUNCTION(COM_freeCaches)() | ||||
| Show All 19 Lines | |||||