Commit fb8b1880 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Moved AbstractJob and OpenGLJobProcessor from campvis-core to tgt and adapted...

Moved AbstractJob and OpenGLJobProcessor from campvis-core to tgt and adapted and cleaned up all necessary includes/references.
parent 58512d30
......@@ -26,8 +26,12 @@
#define OPENGLJOBPROCESSOR_H__
#include "sigslot/sigslot.h"
#include "tgt/glcontextmanager.h"
#include "tgt/job.h"
#include "tgt/runnable.h"
#include "tgt/singleton.h"
#include "tgt/singleton.h"
#include <ext/threading.h>
......@@ -38,18 +42,10 @@
#include <tbb/concurrent_vector.h>
#include <tbb/memory_pool.h>
#include "tgt/glcontextmanager.h"
#include "tgt/singleton.h"
#include "core/coreapi.h"
#include "core/tools/job.h"
namespace tgt {
class GLCanvas;
}
namespace campvis {
/**
* This job processor singleton can be used to execute jobs that need an OpenGL context.
*
......@@ -57,7 +53,7 @@ namespace campvis {
* and acquired OpenGL context. You can execute OpenGL calls asynchroniously using enqueueJob()
* or synchronously using the ScopedSynchronousGlJobExecution guard.
*/
class CAMPVIS_CORE_API OpenGLJobProcessor : public tgt::Singleton<OpenGLJobProcessor>, public tgt::Runnable, public sigslot::has_slots {
class TGT_API OpenGLJobProcessor : public tgt::Singleton<OpenGLJobProcessor>, public tgt::Runnable, public sigslot::has_slots {
friend class tgt::Singleton<OpenGLJobProcessor>; ///< CRTP
friend class AbstractJob; ///< so the custom new/delete operator can access the memory pool
......@@ -68,7 +64,7 @@ namespace campvis {
* does nothing. If this thread is not the OpenGL thread, the OpenGLJobProcessor is paused,
* an arbitrary OpenGL context acquired. Upon destruction the OpenGLJobProcessor is resumed.
*/
class CAMPVIS_CORE_API ScopedSynchronousGlJobExecution {
class TGT_API ScopedSynchronousGlJobExecution {
public:
ScopedSynchronousGlJobExecution();
~ScopedSynchronousGlJobExecution();
......@@ -142,6 +138,6 @@ namespace campvis {
}
#define GLJobProc tgt::Singleton<campvis::OpenGLJobProcessor>::getRef()
#define GLJobProc tgt::Singleton<tgt::OpenGLJobProcessor>::getRef()
#endif // OPENGLJOBPROCESSOR_H__
......@@ -24,16 +24,14 @@
#include "cmbatchgeneration.h"
#include "tgt/event/keyevent.h"
#include "tgt/filesystem.h"
#include "tgt/glcontextmanager.h"
#include "tgt/event/keyevent.h"
#include "core/classification/geometry1dtransferfunction.h"
#include "core/classification/tfgeometry1d.h"
#include "core/datastructures/imagerepresentationgl.h"
#include "core/datastructures/renderdata.h"
#include "core/tools/opengljobprocessor.h"
#include "core/tools/simplejobprocessor.h"
#include "core/tools/job.h"
#ifdef CAMPVIS_HAS_MODULE_DEVIL
#include <IL/il.h>
......@@ -125,8 +123,10 @@ namespace campvis {
return;
p_autoExecution.setValue(false);
tgt::GLContextScopedLock lock(_canvas, true);
for (int i = p_range.getValue().x; i < p_range.getValue().y; ++i) {
GLJobProc.enqueueJob(_canvas, makeJobOnHeap(this, &CmBatchGeneration::executePass, i), OpenGLJobProcessor::SerialJob);
executePass(i);
}
}
......
......@@ -40,8 +40,6 @@
#include "core/datastructures/renderdata.h"
#include "core/datastructures/genericimagerepresentationlocal.h"
#include "core/tools/opengljobprocessor.h"
#include "core/tools/quadrenderer.h"
#include "core/tools/stringutils.h"
#include "core/tools/mapping.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment