[Bf-blender-cvs] [e919629] soc-2014-viewport_context: Cleanup (sync edits with master)

Campbell Barton noreply at git.blender.org
Thu Jul 24 10:54:19 CEST 2014


Commit: e9196291be8990c629f9cfc192cefee70838275f
Author: Campbell Barton
Date:   Thu Jul 24 18:53:30 2014 +1000
Branches: soc-2014-viewport_context
https://developer.blender.org/rBe9196291be8990c629f9cfc192cefee70838275f

Cleanup (sync edits with master)

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

M	intern/ghost/intern/GHOST_Window.h
M	intern/ghost/intern/GHOST_WindowCocoa.mm
M	intern/ghost/intern/GHOST_WindowSDL.cpp
M	intern/ghost/intern/GHOST_WindowSDL.h
M	intern/ghost/intern/GHOST_WindowWin32.cpp
M	intern/ghost/intern/GHOST_WindowWin32.h
M	intern/ghost/intern/GHOST_WindowX11.cpp
M	intern/ghost/intern/GHOST_WindowX11.h

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

diff --git a/intern/ghost/intern/GHOST_Window.h b/intern/ghost/intern/GHOST_Window.h
index c6634d3..6d06437 100644
--- a/intern/ghost/intern/GHOST_Window.h
+++ b/intern/ghost/intern/GHOST_Window.h
@@ -94,7 +94,7 @@ public:
 	 * virtual GHOST_TSuccess activateDrawingContext() = 0;
 	 * virtual GHOST_TSuccess invalidate() = 0;
 	 */
-
+	 
 	/**
 	 * Destructor.
 	 * Closes the window and disposes resources allocated.
@@ -387,7 +387,7 @@ protected:
 	float m_nativePixelSize;
 
 private:
-	GHOST_Context* m_context;
+	GHOST_Context *m_context;
 };
 
 
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm
index 00af40f..52436d3 100644
--- a/intern/ghost/intern/GHOST_WindowCocoa.mm
+++ b/intern/ghost/intern/GHOST_WindowCocoa.mm
@@ -1174,7 +1174,7 @@ GHOST_TSuccess GHOST_WindowCocoa::setOrder(GHOST_TWindowOrder order)
 
 #pragma mark Drawing context
 
-GHOST_Context* GHOST_WindowCocoa::newDrawingContext(GHOST_TDrawingContextType type)
+GHOST_Context *GHOST_WindowCocoa::newDrawingContext(GHOST_TDrawingContextType type)
 {
 	if (type == GHOST_kDrawingContextTypeOpenGL) {
 #if !defined(WITH_GL_EGL)
diff --git a/intern/ghost/intern/GHOST_WindowSDL.cpp b/intern/ghost/intern/GHOST_WindowSDL.cpp
index 60aa54f..2a875e5 100644
--- a/intern/ghost/intern/GHOST_WindowSDL.cpp
+++ b/intern/ghost/intern/GHOST_WindowSDL.cpp
@@ -648,7 +648,7 @@ GHOST_WindowSDL::setSwapInterval(int interval)
 }
 
 GHOST_TSuccess
-GHOST_WindowSDL::getSwapInterval(int& intervalOut)
+GHOST_WindowSDL::getSwapInterval(int &intervalOut)
 {
 	intervalOut = SDL_GL_GetSwapInterval();
 	return GHOST_kSuccess;
diff --git a/intern/ghost/intern/GHOST_WindowSDL.h b/intern/ghost/intern/GHOST_WindowSDL.h
index 1715b46..402d2e2 100644
--- a/intern/ghost/intern/GHOST_WindowSDL.h
+++ b/intern/ghost/intern/GHOST_WindowSDL.h
@@ -174,7 +174,7 @@ protected:
 	GHOST_TSuccess endFullScreen() const { return GHOST_kFailure; }
 
 	GHOST_TSuccess setSwapInterval(int interval);
-	GHOST_TSuccess getSwapInterval(int& intervalOut);
+	GHOST_TSuccess getSwapInterval(int &intervalOut);
 };
 
 
diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp
index 4fc4a67..e6eb457 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.cpp
+++ b/intern/ghost/intern/GHOST_WindowWin32.cpp
@@ -209,7 +209,6 @@ GHOST_WindowWin32::GHOST_WindowWin32(
 		    0);                         // pointer to window-creation data
 		free(title_16);
 	}
-
 	if (m_hWnd) {
 		// Register this window as a droptarget. Requires m_hWnd to be valid.
 		// Note that OleInitialize(0) has to be called prior to this. Done in GHOST_SystemWin32.
@@ -243,7 +242,6 @@ GHOST_WindowWin32::GHOST_WindowWin32(
 			}
 
 			::ShowWindow(m_hWnd, nCmdShow);
-
 			// Force an initial paint of the window
 			::UpdateWindow(m_hWnd);
 		}
@@ -329,10 +327,11 @@ GHOST_WindowWin32::GHOST_WindowWin32(
 
 GHOST_WindowWin32::~GHOST_WindowWin32()
 {
-	if (m_Bar) {
+	if (m_Bar)
+	{
 		m_Bar->SetProgressState(m_hWnd, TBPF_NOPROGRESS);
 		m_Bar->Release();
-	}
+	};
 
 	if (m_wintab) {
 		GHOST_WIN32_WTClose fpWTClose = (GHOST_WIN32_WTClose) ::GetProcAddress(m_wintab, "WTClose");
@@ -344,15 +343,14 @@ GHOST_WindowWin32::~GHOST_WindowWin32()
 			m_tabletData = NULL;
 		}
 	}
-
 	if (m_customCursor) {
 		DestroyCursor(m_customCursor);
 		m_customCursor = NULL;
 	}
 
-	if (m_hWnd != NULL && m_hDC != NULL && releaseNativeHandles())
+	if (m_hWnd != NULL && m_hDC != NULL && releaseNativeHandles()) {
 		::ReleaseDC(m_hWnd, m_hDC);
-
+	}
 	if (m_hWnd) {
 		if (m_dropTarget) {
 			// Disable DragDrop
@@ -611,35 +609,35 @@ GHOST_Context* GHOST_WindowWin32::newDrawingContext(GHOST_TDrawingContextType ty
 #if !defined(WITH_GL_EGL)
 
 #if defined(WITH_GL_PROFILE_CORE)
-		GHOST_Context* context = new GHOST_ContextWGL(
-			m_wantStereoVisual,
-			m_wantNumOfAASamples,
-			m_hWnd,
-			m_hDC,
-			WGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
-			3, 2,
-			GHOST_OPENGL_WGL_CONTEXT_FLAGS,
-			GHOST_OPENGL_WGL_RESET_NOTIFICATION_STRATEGY);
+		GHOST_Context *context = new GHOST_ContextWGL(
+		        m_wantStereoVisual,
+		        m_wantNumOfAASamples,
+		        m_hWnd,
+		        m_hDC,
+		        WGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
+		        3, 2,
+		        GHOST_OPENGL_WGL_CONTEXT_FLAGS,
+		        GHOST_OPENGL_WGL_RESET_NOTIFICATION_STRATEGY);
 #elif defined(WITH_GL_PROFILE_ES20)
-		GHOST_Context* context = new GHOST_ContextWGL(
-			m_wantStereoVisual,
-			m_wantNumOfAASamples,
-			m_hWnd,
-			m_hDC,
-			WGL_CONTEXT_ES2_PROFILE_BIT_EXT,
-			2, 0,
-			GHOST_OPENGL_WGL_CONTEXT_FLAGS,
-			GHOST_OPENGL_WGL_RESET_NOTIFICATION_STRATEGY);
+		GHOST_Context *context = new GHOST_ContextWGL(
+		        m_wantStereoVisual,
+		        m_wantNumOfAASamples,
+		        m_hWnd,
+		        m_hDC,
+		        WGL_CONTEXT_ES2_PROFILE_BIT_EXT,
+		        2, 0,
+		        GHOST_OPENGL_WGL_CONTEXT_FLAGS,
+		        GHOST_OPENGL_WGL_RESET_NOTIFICATION_STRATEGY);
 #elif defined(WITH_GL_PROFILE_COMPAT)
-		GHOST_Context* context = new GHOST_ContextWGL(
-			m_wantStereoVisual,
-			m_wantNumOfAASamples,
-			m_hWnd,
-			m_hDC,
-			0, // profile bit
-			0, 0,
-			GHOST_OPENGL_WGL_CONTEXT_FLAGS,
-			GHOST_OPENGL_WGL_RESET_NOTIFICATION_STRATEGY);
+		GHOST_Context *context = new GHOST_ContextWGL(
+		        m_wantStereoVisual,
+		        m_wantNumOfAASamples,
+		        m_hWnd,
+		        m_hDC,
+		        0, // profile bit
+		        0, 0,
+		        GHOST_OPENGL_WGL_CONTEXT_FLAGS,
+		        GHOST_OPENGL_WGL_RESET_NOTIFICATION_STRATEGY);
 #else
 #  error
 #endif
@@ -647,38 +645,38 @@ GHOST_Context* GHOST_WindowWin32::newDrawingContext(GHOST_TDrawingContextType ty
 #else
 
 #if defined(WITH_GL_PROFILE_CORE)
-		GHOST_Context* context = new GHOST_ContextEGL(
-			m_wantStereoVisual,
-			m_wantNumOfAASamples,
-			m_hWnd,
-			m_hDC,
-			EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
-			3, 2,
-			GHOST_OPENGL_EGL_CONTEXT_FLAGS,
-			GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
-			EGL_OPENGL_API);
+		GHOST_Context *context = new GHOST_ContextEGL(
+		        m_wantStereoVisual,
+		        m_wantNumOfAASamples,
+		        m_hWnd,
+		        m_hDC,
+		        EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
+		        3, 2,
+		        GHOST_OPENGL_EGL_CONTEXT_FLAGS,
+		        GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
+		        EGL_OPENGL_API);
 #elif defined(WITH_GL_PROFILE_ES20)
-		GHOST_Context* context = new GHOST_ContextEGL(
-			m_wantStereoVisual,
-			m_wantNumOfAASamples,
-			m_hWnd,
-			m_hDC,
-			0, // profile bit
-			2, 0,
-			GHOST_OPENGL_EGL_CONTEXT_FLAGS,
-			GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
-			EGL_OPENGL_ES_API);
+		GHOST_Context *context = new GHOST_ContextEGL(
+		        m_wantStereoVisual,
+		        m_wantNumOfAASamples,
+		        m_hWnd,
+		        m_hDC,
+		        0, // profile bit
+		        2, 0,
+		        GHOST_OPENGL_EGL_CONTEXT_FLAGS,
+		        GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
+		        EGL_OPENGL_ES_API);
 #elif defined(WITH_GL_PROFILE_COMPAT)
-		GHOST_Context* context = new GHOST_ContextEGL(
-			m_wantStereoVisual,
-			m_wantNumOfAASamples,
-			m_hWnd,
-			m_hDC,
-			0, // profile bit
-			0, 0,
-			GHOST_OPENGL_EGL_CONTEXT_FLAGS,
-			GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
-			EGL_OPENGL_API);
+		GHOST_Context *context = new GHOST_ContextEGL(
+		        m_wantStereoVisual,
+		        m_wantNumOfAASamples,
+		        m_hWnd,
+		        m_hDC,
+		        0, // profile bit
+		        0, 0,
+		        GHOST_OPENGL_EGL_CONTEXT_FLAGS,
+		        GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
+		        EGL_OPENGL_API);
 #else
 #  error
 #endif
@@ -693,8 +691,6 @@ GHOST_Context* GHOST_WindowWin32::newDrawingContext(GHOST_TDrawingContextType ty
 	return NULL;
 }
 
-
-
 void GHOST_WindowWin32::lostMouseCapture()
 {
 	if (m_hasMouseCaptured)
diff --git a/intern/ghost/intern/GHOST_WindowWin32.h b/intern/ghost/intern/GHOST_WindowWin32.h
index d129162..beebfb7 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.h
+++ b/intern/ghost/intern/GHOST_WindowWin32.h
@@ -66,13 +66,13 @@ public:
 	 * Constructor.
 	 * Creates a new window and opens it.
 	 * To check if the window was created properly, use the getValid() method.
-	 * \param title              The text shown in the title bar of the window.
-	 * \param left               The coordinate of the left edge of the window.
-	 * \param top                The coordinate of the top edge of the window.
-	 * \param width              The width the window.
-	 * \param height             The height the window.
-	 * \param state              The state the window is initially opened with.
-	 * \param type               The type of drawing context installed in this window.
+	 * \param title		The text shown in the title bar of the window.
+	 * \param left		The coordinate of the left edge of the window.
+	 * \param top		The coordinate of the top edge of the window.
+	 * \param width		The width the window.
+	 * \param height	The height the window.
+	 * \param state		The state the window is initially opened with.
+	 * \param type		The type of drawing context installed in this window.
 	 * \param wantStereoVisual   Stereo visual for quad buffered stereo.
 	 * \param wantNumOfAASamples Number of samples used for AA (zero if no AA)
 	 * \param parentWindowHwnd
diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp
index 47b5e13..8df6164 100644
--- a/intern/ghost/intern/GHOST_WindowX11.cpp
+++ b/intern/ghost/intern/GHOST_WindowX11.cpp
@@ -195,12 +195,12 @@ GHOST_WindowX11(
 
 	xattributes_valuemask |= CWEventMask;
 	xattributes.event_mask =
-	        ExposureMask       | StructureNotifyMask |
-	        KeyPressMask       | KeyReleaseMask      |
-	        EnterWindowMask    | LeaveWindowMask     |
-	        ButtonPressMask    | ButtonReleaseMask   |
-	        PointerMotionMask  | FocusChangeMask     |
-	        PropertyChangeMask | KeymapStateMask     ;
+	        ExposureMask | StructureNotifyMask |
+	        KeyPressMask | KeyReleaseMask |
+	        EnterWindowMask | LeaveWindowMask |
+	        ButtonPressMask | ButtonReleaseMask |
+	        PointerMotionMask | FocusChangeMask |
+	        PropertyChangeMask | KeymapStateMask;
 
 	if (exclusive) {
 		xattributes_valuemas

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list