summaryrefslogtreecommitdiff
path: root/indra/llrender/llimagegl.h
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2021-10-15 14:02:17 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2021-10-15 14:02:17 +0100
commite0ea20a3c95197c042da9684b5e9e2f7d4f126fd (patch)
treea6b6c74e89b31f59aca624fe3e61d48ce2fdfb99 /indra/llrender/llimagegl.h
parent7868ba0c60ff762f56180121fd117e350767934e (diff)
parent02f813d17bcf4592f6425e207e9fe487275b9354 (diff)
Merge branch 'DRTVWR-546' of ssh://bitbucket.org/lindenlab/viewer into DRTVWR-546
Diffstat (limited to 'indra/llrender/llimagegl.h')
-rw-r--r--indra/llrender/llimagegl.h35
1 files changed, 32 insertions, 3 deletions
diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h
index 61ddc8d59b..8e9b483c2d 100644
--- a/indra/llrender/llimagegl.h
+++ b/indra/llrender/llimagegl.h
@@ -35,9 +35,11 @@
#include "llrefcount.h"
#include "v2math.h"
#include "llunits.h"
-
+#include "llthreadsafequeue.h"
#include "llrender.h"
class LLTextureAtlas ;
+class LLWindow;
+
#define BYTES_TO_MEGA_BYTES(x) ((x) >> 20)
#define MEGA_BYTES_TO_BYTES(x) ((x) << 20)
@@ -102,7 +104,7 @@ public:
void setAllowCompression(bool allow) { mAllowCompression = allow; }
static void setManualImage(U32 target, S32 miplevel, S32 intformat, S32 width, S32 height, U32 pixformat, U32 pixtype, const void *pixels, bool allow_compression = true);
-
+
BOOL createGLTexture() ;
BOOL createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S32 usename = 0, BOOL to_create = TRUE,
S32 category = sMaxCategories-1);
@@ -265,7 +267,8 @@ public:
#endif
public:
- static void initClass(S32 num_catagories, BOOL skip_analyze_alpha = false);
+ static void initClass(LLWindow* window, S32 num_catagories, BOOL skip_analyze_alpha = false);
+ static void updateClass();
static void cleanupClass() ;
private:
@@ -301,4 +304,30 @@ public:
};
+class LLImageGLThread : public LLThread
+{
+public:
+ LLImageGLThread(LLWindow* window);
+
+ // post a function to be executed on the LLImageGL background thread
+ bool post(const std::function<void()>& func);
+
+ //post a callback to be executed on the main thread
+ bool postCallback(const std::function<void()>& callback);
+
+ void executeCallbacks();
+
+ void run() override;
+
+ LLThreadSafeQueue<std::function<void()>> mFunctionQueue;
+ LLThreadSafeQueue<std::function<void()>> mCallbackQueue;
+
+ LLWindow* mWindow;
+ void* mContext;
+ LLAtomicBool mFinished;
+
+ static LLImageGLThread* sInstance;
+};
+
+
#endif // LL_LLIMAGEGL_H