summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-04-23 01:10:19 +0200
committerCarl Hetherington <cth@carlh.net>2021-04-23 01:10:19 +0200
commit1427d3d34589cd779d5e06da281e6fd65a765ccb (patch)
tree5be2f459c05c32dc2dffa53429deef5d43e97e54
parent178cb8bfa20aac8e5dd0474b21c0e7a95419b546 (diff)
I can't convince myself that _canvas_mutex is doing anything useful, so remove it.
-rw-r--r--src/wx/gl_video_view.cc39
-rw-r--r--src/wx/gl_video_view.h4
2 files changed, 16 insertions, 27 deletions
diff --git a/src/wx/gl_video_view.cc b/src/wx/gl_video_view.cc
index bda3a58ec..7bf9e3adc 100644
--- a/src/wx/gl_video_view.cc
+++ b/src/wx/gl_video_view.cc
@@ -122,20 +122,18 @@ GLVideoView::check_for_butler_errors ()
}
+/** Called from the UI thread */
void
GLVideoView::update ()
{
- {
- boost::mutex::scoped_lock lm (_canvas_mutex);
- if (!_canvas->IsShownOnScreen()) {
- return;
- }
+ if (!_canvas->IsShownOnScreen()) {
+ return;
+ }
#ifdef DCPOMATIC_OSX
- /* macOS gives errors if we don't do this (and therefore [NSOpenGLContext setView:]) from the main thread */
- ensure_context ();
+ /* macOS gives errors if we don't do this (and therefore [NSOpenGLContext setView:]) from the main thread */
+ ensure_context ();
#endif
- }
if (!_thread.joinable()) {
_thread = boost::thread (boost::bind(&GLVideoView::thread, this));
@@ -262,7 +260,6 @@ DCPOMATIC_ENABLE_WARNINGS
glFlush();
check_gl_error ("glFlush");
- boost::mutex::scoped_lock lm (_canvas_mutex);
_canvas->SwapBuffers();
}
@@ -364,23 +361,19 @@ try
{
start_of_thread ("GLVideoView");
- {
- boost::mutex::scoped_lock lm (_canvas_mutex);
-
#if defined(DCPOMATIC_OSX)
- /* Without this we see errors like
- * ../src/osx/cocoa/glcanvas.mm(194): assert ""context"" failed in SwapBuffers(): should have current context [in thread 700006970000]
- */
- WXGLSetCurrentContext (_context->GetWXGLContext());
+ /* Without this we see errors like
+ * ../src/osx/cocoa/glcanvas.mm(194): assert ""context"" failed in SwapBuffers(): should have current context [in thread 700006970000]
+ */
+ WXGLSetCurrentContext (_context->GetWXGLContext());
#else
- /* We must call this here on Linux otherwise we get no image (for reasons
- * that aren't clear). However, doing ensure_context() from this thread
- * on macOS gives
- * "[NSOpenGLContext setView:] must be called from the main thread".
- */
- ensure_context ();
+ /* We must call this here on Linux otherwise we get no image (for reasons
+ * that aren't clear). However, doing ensure_context() from this thread
+ * on macOS gives
+ * "[NSOpenGLContext setView:] must be called from the main thread".
+ */
+ ensure_context ();
#endif
- }
#if defined(DCPOMATIC_LINUX) && defined(DCPOMATIC_HAVE_GLX_SWAP_INTERVAL_EXT)
if (_canvas->IsExtensionSupported("GLX_EXT_swap_control")) {
diff --git a/src/wx/gl_video_view.h b/src/wx/gl_video_view.h
index 4601eb02d..36edd6b8b 100644
--- a/src/wx/gl_video_view.h
+++ b/src/wx/gl_video_view.h
@@ -64,10 +64,6 @@ private:
void ensure_context ();
void size_changed (wxSizeEvent const &);
- /* Mutex for use of _canvas; it's only contended when our ::thread
- is started up so this may be overkill.
- */
- boost::mutex _canvas_mutex;
wxGLCanvas* _canvas;
wxGLContext* _context;