summaryrefslogtreecommitdiff
path: root/retrace/daemon/glframe_os.hpp
diff options
context:
space:
mode:
authorMark Janes <mark.a.janes@intel.com>2015-05-07 16:06:20 -0700
committerMark Janes <mark.a.janes@intel.com>2017-06-19 14:04:44 -0700
commitbcb773b1e2ac7d5a72961a8062aa291bc9ec76da (patch)
treeb43f606691c223d59a22faa63a0aefa701ec8d6c /retrace/daemon/glframe_os.hpp
parent92eee3340089f2c1fe699a3ad23cb7b1aa540e11 (diff)
got working file open and render targets
In order to display images properly, I had to create a QQuickImageProvider. I also added a dialog for opening the file.
Diffstat (limited to 'retrace/daemon/glframe_os.hpp')
-rw-r--r--retrace/daemon/glframe_os.hpp65
1 files changed, 65 insertions, 0 deletions
diff --git a/retrace/daemon/glframe_os.hpp b/retrace/daemon/glframe_os.hpp
new file mode 100644
index 00000000..c213a1ad
--- /dev/null
+++ b/retrace/daemon/glframe_os.hpp
@@ -0,0 +1,65 @@
+// Copyright (C) Intel Corp. 2014. All Rights Reserved.
+
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+
+// The above copyright notice and this permission notice (including the
+// next paragraph) shall be included in all copies or substantial
+// portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+// IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// **********************************************************************/
+// * Authors:
+// * Mark Janes <mark.a.janes@intel.com>
+// **********************************************************************/
+
+#ifndef _GLFRAME_OS_H_
+#define _GLFRAME_OS_H_
+
+#include <mutex>
+#include <condition_variable>
+//#include <pthread.h>
+
+#include "glframe_traits.hpp"
+
+namespace glretrace {
+
+typedef std::lock_guard<std::mutex> ScopedLock;
+
+class Semaphore : NoCopy, NoAssign, NoMove {
+public:
+ Semaphore() : m_count(0) {}
+
+ void post() {
+ std::lock_guard<std::mutex> lk(m_mutex);
+ ++m_count;
+ m_cv.notify_one();
+ }
+ void wait() {
+ std::unique_lock<std::mutex> lk(m_mutex);
+ while(!m_count)
+ m_cv.wait(lk);
+ --m_count;
+ }
+private:
+ unsigned long m_count;
+ unsigned long m_max_count;
+ std::mutex m_mutex;
+ std::condition_variable m_cv;
+};
+
+} // namespace Grafips
+
+#endif // _GLFRAME_OS_H_