[Bf-blender-cvs] [d56908d] soc-2014-viewport_fx: Some changes to OSX GHOST contexts got left out of previous separation of wanted parameters and actual parameters

Jason Wilkins noreply at git.blender.org
Fri Jun 27 12:50:05 CEST 2014


Commit: d56908df514da85848e9039cbddf4b6d2ee3a590
Author: Jason Wilkins
Date:   Wed Jun 25 23:14:06 2014 -0500
https://developer.blender.org/rBd56908df514da85848e9039cbddf4b6d2ee3a590

Some changes to OSX GHOST contexts got left out of previous separation of wanted parameters and actual parameters

===================================================================

M	intern/ghost/intern/GHOST_ContextCGL.h
M	intern/ghost/intern/GHOST_ContextCGL.mm
M	intern/ghost/intern/GHOST_WindowCocoa.mm

===================================================================

diff --git a/intern/ghost/intern/GHOST_ContextCGL.h b/intern/ghost/intern/GHOST_ContextCGL.h
index bfc7676..8da6fab 100644
--- a/intern/ghost/intern/GHOST_ContextCGL.h
+++ b/intern/ghost/intern/GHOST_ContextCGL.h
@@ -92,11 +92,9 @@ public:
 
 	/**
 	 * Call immediately after new to initialize.  If this fails then immediately delete the object.
-	 * \param stereoVisual		Stereo visual for quad buffered stereo.
-	 * \param numOfAASamples	Number of samples used for AA (zero if no AA)
 	 * \return Indication as to whether initialization has succeeded.
 	 */
-	virtual GHOST_TSuccess initializeDrawingContext(bool stereoVisual = false, GHOST_TUns16 numOfAASamples = 0);
+	virtual GHOST_TSuccess initializeDrawingContext();
 
 	/**
 	 * Updates the drawing context of this window. Needed
diff --git a/intern/ghost/intern/GHOST_ContextCGL.mm b/intern/ghost/intern/GHOST_ContextCGL.mm
index d478575..12837a6 100644
--- a/intern/ghost/intern/GHOST_ContextCGL.mm
+++ b/intern/ghost/intern/GHOST_ContextCGL.mm
@@ -247,7 +247,7 @@ static void makeAttribList(
 
 
 
-GHOST_TSuccess GHOST_ContextCGL::initializeDrawingContext(bool stereoVisual, GHOST_TUns16 numOfAASamples)
+GHOST_TSuccess GHOST_ContextCGL::initializeDrawingContext()
 {
 	NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 
@@ -268,35 +268,35 @@ GHOST_TSuccess GHOST_ContextCGL::initializeDrawingContext(bool stereoVisual, GHO
 	static const bool needStencil = false;
 #endif
 
-	makeAttribList(attribs, stereoVisual, numOfAASamples, needAlpha, needStencil);
+	makeAttribList(attribs, m_stereoVisual, m_numOfAASamples, needAlpha, needStencil);
 
 	NSOpenGLPixelFormat *pixelFormat;
 
 	pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:&attribs[0]];
 
 	// Fall back to no multisampling if Antialiasing init failed
-	if (numOfAASamples > 0 && pixelFormat == nil) {
+	if (m_numOfAASamples > 0 && pixelFormat == nil) {
 		// XXX jwilkins: Does CGL only succeed when it makes an exact match on the number of samples?
 		// Does this need to explicitly try for a lesser match before giving up?
 		// (Now that I think about it, does WGL really require the code that it has for finding a lesser match?)
 
 		attribs.clear();
-		makeAttribList(attribs, stereoVisual, 0, needAlpha, needStencil);
+		makeAttribList(attribs, m_stereoVisual, 0, needAlpha, needStencil);
 		pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:&attribs[0]];
 	}
 
 	if (pixelFormat == nil)
 		goto error;
 
-	if (numOfAASamples > 0) { //Set m_numOfAASamples to the actual value
+	if (m_numOfAASamples > 0) { //Set m_numOfAASamples to the actual value
 		GLint actualSamples;
 		[pixelFormat getValues:&actualSamples forAttribute:NSOpenGLPFASamples forVirtualScreen:0];
 
-		if (numOfAASamples != (GHOST_TUns16)actualSamples) {
+		if (m_numOfAASamples != (GHOST_TUns16)actualSamples) {
 			fprintf(
 				stderr,
 				"Warning! Unable to find a multisample pixel format that supports exactly %d samples. Substituting one that uses %d samples.\n",
-				numOfAASamples,
+				m_numOfAASamples,
 				actualSamples);
 
 			m_numOfAASamples = (GHOST_TUns16)actualSamples;
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm
index 35e7e22..0929e89 100644
--- a/intern/ghost/intern/GHOST_WindowCocoa.mm
+++ b/intern/ghost/intern/GHOST_WindowCocoa.mm
@@ -1205,8 +1205,8 @@ GHOST_Context* GHOST_WindowCocoa::newDrawingContext(GHOST_TDrawingContextType ty
 			GHOST_OPENGL_CGL_RESET_NOTIFICATION_STRATEGY);
 #elif defined(WITH_GL_PROFILE_COMPAT)
 		GHOST_Context* context = new GHOST_ContextCGL(
-			m_initStereoVisual,
-			m_initNumOfAASamples,
+			m_wantStereoVisual,
+			m_wantNumOfAASamples,
 			m_window,
 			m_openGLView,
 			0,
@@ -1221,8 +1221,8 @@ GHOST_Context* GHOST_WindowCocoa::newDrawingContext(GHOST_TDrawingContextType ty
 
 #if defined(WITH_GL_PROFILE_CORE)
 		GHOST_Context* context = new GHOST_ContextEGL(
-			m_initStereoVisual,
-			m_initNumOfAASamples,
+			m_wantStereoVisual,
+			m_wantNumOfAASamples,
 			m_window,
 			m_openGLView,
 			EGL_OPENGL_API,
@@ -1232,8 +1232,8 @@ GHOST_Context* GHOST_WindowCocoa::newDrawingContext(GHOST_TDrawingContextType ty
 			GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY);
 #elif defined(WITH_GL_PROFILE_ES20)
 		GHOST_Context* context = new GHOST_ContextEGL(
-			m_initStereoVisual,
-			m_initNumOfAASamples,
+			m_wantStereoVisual,
+			m_wantNumOfAASamples,
 			m_window,
 			m_openGLView,
 			EGL_OPENGL_ES_API,
@@ -1243,8 +1243,8 @@ GHOST_Context* GHOST_WindowCocoa::newDrawingContext(GHOST_TDrawingContextType ty
 			GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY);
 #elif defined(WITH_GL_PROFILE_COMPAT)
 		GHOST_Context* context = new GHOST_ContextEGL(
-			m_initStereoVisual,
-			m_initNumOfAASamples,
+			m_wantStereoVisual,
+			m_wantNumOfAASamples,
 			m_window,
 			m_openGLView,
 			EGL_OPENGL_API,




More information about the Bf-blender-cvs mailing list