[Mesa-stable] [PATCH] GLView.cpp: Fix Haiku GL lock/unlock issue

Ken Mays kmays2000 at gmail.com
Sat Sep 21 17:29:02 UTC 2019


>From f7fd962767c26bd898f00242e576b6edef434af8 Mon Sep 17 00:00:00 2001
From: kenmays <maybird1776 at yahoo.com>
Date: Fri, 20 Sep 2019 19:22:40 +0000
Subject: [PATCH] GLView.cpp: Fix GL lock/unlock issue

---
 src/hgl/GLView.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/hgl/GLView.cpp b/src/hgl/GLView.cpp
index 9ae5b5c83ac..05e12fc52df 100644
--- a/src/hgl/GLView.cpp
+++ b/src/hgl/GLView.cpp
@@ -51,6 +51,7 @@ BGLView::BGLView(BRect rect, const char* name, ulong
resizingMode, ulong mode,
 	fDitherMap(NULL)
 {
 	fRoster = new GLRendererRoster(this, options);
+	fRenderer = fRoster->GetRenderer();
 }


@@ -68,16 +69,16 @@ BGLView::LockGL()
 	// TODO: acquire the OpenGL API lock it on this glview

 	fDisplayLock.Lock();
-	if (fRenderer)
-		fRenderer->LockGL();
+	if (fRenderer != NULL && fDisplayLock.CountLocks() == 1)
+ 		fRenderer->LockGL();
 }


 void
 BGLView::UnlockGL()
 {
-	if (fRenderer)
-		fRenderer->UnlockGL();
+	if (fRenderer != NULL && fDisplayLock.CountLocks() == 1)
+ 		fRenderer->UnlockGL();
 	fDisplayLock.Unlock();

 	// TODO: release the GL API lock to others glviews
-- 
2.22.0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-stable/attachments/20190921/f5c80f0d/attachment.html>


More information about the mesa-stable mailing list