[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58337] branches/soc-2013-viewport_fx: cleanup of gpu_matrix.c

Jason Wilkins Jason.A.Wilkins at gmail.com
Wed Jul 17 13:44:02 CEST 2013


Revision: 58337
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58337
Author:   jwilkins
Date:     2013-07-17 11:44:01 +0000 (Wed, 17 Jul 2013)
Log Message:
-----------
cleanup of gpu_matrix.c

Modified Paths:
--------------
    branches/soc-2013-viewport_fx/CMakeLists.txt
    branches/soc-2013-viewport_fx/source/blender/editors/mask/mask_draw.c
    branches/soc-2013-viewport_fx/source/blender/editors/screen/area.c
    branches/soc-2013-viewport_fx/source/blender/editors/screen/glutil.c
    branches/soc-2013-viewport_fx/source/blender/editors/screen/screendump.c
    branches/soc-2013-viewport_fx/source/blender/editors/sculpt_paint/paint_cursor.c
    branches/soc-2013-viewport_fx/source/blender/editors/space_image/image_draw.c
    branches/soc-2013-viewport_fx/source/blender/editors/space_view3d/drawobject.c
    branches/soc-2013-viewport_fx/source/blender/gpu/GPU_matrix.h
    branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_deprecated.h
    branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_matrix.c
    branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_safety.h
    branches/soc-2013-viewport_fx/source/blender/windowmanager/intern/wm_playanim.c

Modified: branches/soc-2013-viewport_fx/CMakeLists.txt
===================================================================
--- branches/soc-2013-viewport_fx/CMakeLists.txt	2013-07-17 11:41:44 UTC (rev 58336)
+++ branches/soc-2013-viewport_fx/CMakeLists.txt	2013-07-17 11:44:01 UTC (rev 58337)
@@ -2069,6 +2069,10 @@
 	endif()
 endif()
 
+if(NOT WITH_GL_SYSTEM_LEGACY)
+	set(GL_DEFINITIONS "${GL_DEFINITIONS} -DGLEW_NO_GLU")
+endif()
+
 #-----------------------------------------------------------------------------
 # Configure Bullet
 

Modified: branches/soc-2013-viewport_fx/source/blender/editors/mask/mask_draw.c
===================================================================
--- branches/soc-2013-viewport_fx/source/blender/editors/mask/mask_draw.c	2013-07-17 11:41:44 UTC (rev 58336)
+++ branches/soc-2013-viewport_fx/source/blender/editors/mask/mask_draw.c	2013-07-17 11:44:01 UTC (rev 58337)
@@ -596,9 +596,9 @@
 	}
 
 	/* apply transformation so mask editing tools will assume drawing from the origin in normalized space */
-	glPushMatrix();
-	glTranslatef(x + xofs, y + yofs, 0);
-	glScalef(maxdim * zoomx, maxdim * zoomy, 0);
+	gpuPushMatrix();
+	gpuTranslate(x + xofs, y + yofs, 0);
+	gpuScale(maxdim * zoomx, maxdim * zoomy, 0);
 
 	if (stabmat) {
 		gpuMultMatrix(stabmat);
@@ -615,7 +615,7 @@
 		ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_VIEW);
 	}
 
-	glPopMatrix();
+	gpuPopMatrix();
 }
 
 void ED_mask_draw_frames(Mask *mask, ARegion *ar, const int cfra, const int sfra, const int efra)

Modified: branches/soc-2013-viewport_fx/source/blender/editors/screen/area.c
===================================================================
--- branches/soc-2013-viewport_fx/source/blender/editors/screen/area.c	2013-07-17 11:41:44 UTC (rev 58336)
+++ branches/soc-2013-viewport_fx/source/blender/editors/screen/area.c	2013-07-17 11:44:01 UTC (rev 58337)
@@ -356,8 +356,8 @@
 
 	glEnable(GL_BLEND);
 
-	glPushMatrix();
-	glTranslatef(-ar->winrct.xmin, -ar->winrct.ymin, 0.0f);
+	gpuPushMatrix();
+	gpuTranslate(-ar->winrct.xmin, -ar->winrct.ymin, 0.0f);
 	
 	for (az = sa->actionzones.first; az; az = az->next) {
 		/* test if action zone is over this region */
@@ -387,7 +387,7 @@
 		}
 	}
 
-	glPopMatrix();
+	gpuPopMatrix();
 
 	glDisable(GL_BLEND);
 }

Modified: branches/soc-2013-viewport_fx/source/blender/editors/screen/glutil.c
===================================================================
--- branches/soc-2013-viewport_fx/source/blender/editors/screen/glutil.c	2013-07-17 11:41:44 UTC (rev 58336)
+++ branches/soc-2013-viewport_fx/source/blender/editors/screen/glutil.c	2013-07-17 11:44:01 UTC (rev 58337)
@@ -983,20 +983,20 @@
 
 	BLI_rcti_init(&display_rect, 0, width, 0, height);
 
-	glMatrixMode(GL_PROJECTION);
-	glPushMatrix();
-	glMatrixMode(GL_MODELVIEW);
-	glPushMatrix();
+	gpuMatrixMode(GL_PROJECTION);
+	gpuPushMatrix();
+	gpuMatrixMode(GL_MODELVIEW);
+	gpuPushMatrix();
 
 	glaDefine2DArea(&display_rect);
 
 	glaDrawPixelsTex(0, 0, width, height, GL_RGBA, GL_FLOAT,
 	                 GL_NEAREST, buffer);
 
-	glMatrixMode(GL_PROJECTION);
-	glPopMatrix();
-	glMatrixMode(GL_MODELVIEW);
-	glPopMatrix();
+	gpuMatrixMode(GL_PROJECTION);
+	gpuPopMatrix();
+	gpuMatrixMode(GL_MODELVIEW);
+	gpuPopMatrix();
 
 	GPU_offscreen_read_pixels(ofs, GL_FLOAT, buffer);
 

Modified: branches/soc-2013-viewport_fx/source/blender/editors/screen/screendump.c
===================================================================
--- branches/soc-2013-viewport_fx/source/blender/editors/screen/screendump.c	2013-07-17 11:41:44 UTC (rev 58336)
+++ branches/soc-2013-viewport_fx/source/blender/editors/screen/screendump.c	2013-07-17 11:44:01 UTC (rev 58337)
@@ -404,9 +404,9 @@
 static void screencast_draw_cursor(bContext *UNUSED(C), int x, int y, void *UNUSED(p_ptr))
 {
 	
-	glPushMatrix();
+	gpuPushMatrix();
 	
-	glTranslatef((float)x, (float)y, 0.0f);
+	gpuTranslate((float)x, (float)y, 0.0f);
 	
 	
 	glEnable(GL_LINE_SMOOTH);
@@ -421,7 +421,7 @@
 	glDisable(GL_BLEND);
 	glDisable(GL_LINE_SMOOTH);
 	
-	glPopMatrix();
+	gpuPopMatrix();
 }
 
 /* Turn brush cursor in 3D view on/off */

Modified: branches/soc-2013-viewport_fx/source/blender/editors/sculpt_paint/paint_cursor.c
===================================================================
--- branches/soc-2013-viewport_fx/source/blender/editors/sculpt_paint/paint_cursor.c	2013-07-17 11:41:44 UTC (rev 58336)
+++ branches/soc-2013-viewport_fx/source/blender/editors/sculpt_paint/paint_cursor.c	2013-07-17 11:44:01 UTC (rev 58337)
@@ -542,7 +542,7 @@
 		if (mtex->brush_map_mode == MTEX_MAP_MODE_VIEW) {
 			/* brush rotation */
 			gpuTranslate(0.5, 0.5, 0);
-			gpuRotateAxis((double)RAD2DEGF(ups->brush_rotation), 'Z');
+			gpuRotateAxis(RAD2DEGF(ups->brush_rotation), 'Z');
 			gpuTranslate(-0.5f, -0.5f, 0);
 
 			/* scale based on tablet pressure */
@@ -594,7 +594,7 @@
 			else
 				gpuTranslate(brush->mask_stencil_pos[0], brush->mask_stencil_pos[1], 0);
 			gpuRotateAxis(RAD2DEGF(mtex->rot), 'Z');
-			glMatrixMode(GL_TEXTURE);
+			gpuMatrixMode(GL_TEXTURE);
 		}
 
 		/* set quad color. Colored overlay does not get blending */
@@ -626,8 +626,8 @@
 		gpuPopMatrix();
 
 		if (mtex->brush_map_mode == MTEX_MAP_MODE_STENCIL) {
-			glMatrixMode(GL_MODELVIEW);
-			glPopMatrix();
+			gpuMatrixMode(GL_MODELVIEW);
+			gpuPopMatrix();
 		}
 	}
 }
@@ -653,9 +653,9 @@
 
 		/* scale based on tablet pressure */
 		if (ups->draw_pressure && BKE_brush_use_size_pressure(vc->scene, brush)) {
-			glTranslatef(0.5f, 0.5f, 0);
-			glScalef(1.0f / ups->pressure_value, 1.0f / ups->pressure_value, 1);
-			glTranslatef(-0.5f, -0.5f, 0);
+			gpuTranslate(0.5f, 0.5f, 0);
+			gpuScale(1.0f / ups->pressure_value, 1.0f / ups->pressure_value, 1);
+			gpuTranslate(-0.5f, -0.5f, 0);
 		}
 
 		if (ups->draw_anchored) {

Modified: branches/soc-2013-viewport_fx/source/blender/editors/space_image/image_draw.c
===================================================================
--- branches/soc-2013-viewport_fx/source/blender/editors/space_image/image_draw.c	2013-07-17 11:41:44 UTC (rev 58336)
+++ branches/soc-2013-viewport_fx/source/blender/editors/space_image/image_draw.c	2013-07-17 11:44:01 UTC (rev 58337)
@@ -108,12 +108,12 @@
 			/* find window pixel coordinates of origin */
 			UI_view2d_to_region_no_clip(&ar->v2d, 0.0f, 0.0f, &x, &y);
 
-			glPushMatrix();
-			glTranslatef(x, y, 0.0f);
-			glScalef(zoomx, zoomy, 1.0f);
+			gpuPushMatrix();
+			gpuTranslate(x, y, 0.0f);
+			gpuScale(zoomx, zoomy, 1.0f);
 
 			if (scene->r.mode & R_BORDER) {
-				glTranslatef((int)(-scene->r.border.xmin * scene->r.xsch * scene->r.size / 100.0f),
+				gpuTranslate((int)(-scene->r.border.xmin * scene->r.xsch * scene->r.size / 100.0f),
 				             (int)(-scene->r.border.ymin * scene->r.ysch * scene->r.size / 100.0f),
 				             0.0f);
 			}
@@ -162,7 +162,7 @@
 
 			MEM_freeN(tiles);
 
-			glPopMatrix();
+			gpuPopMatrix();
 		}
 	}
 }

Modified: branches/soc-2013-viewport_fx/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- branches/soc-2013-viewport_fx/source/blender/editors/space_view3d/drawobject.c	2013-07-17 11:41:44 UTC (rev 58336)
+++ branches/soc-2013-viewport_fx/source/blender/editors/space_view3d/drawobject.c	2013-07-17 11:44:01 UTC (rev 58337)
@@ -6161,11 +6161,10 @@
 		GPUprim3 prim = GPU_PRIM_LOFI_WIRE;
 		float radius = size[0] > size[1] ? size[0] : size[1];
 		float length = size[2] > radius ? 2.0f * (size[2] - radius) : 0.0f;
-		gpuImmediateFormat_V3();
-		glTranslatef(cent[0], cent[1], cent[2] - length * 0.5f);
+		gpuTranslate(cent[0], cent[1], cent[2] - length * 0.5f);
 		gpuSingleCylinder(&prim, radius, radius, 1);
 		gpuSingleSphere(&prim, radius);
-		glTranslatef(0.0, 0.0, length);
+		gpuTranslate(0.0, 0.0, length);
 		gpuSingleSphere(&prim, radius);
 	}
 

Modified: branches/soc-2013-viewport_fx/source/blender/gpu/GPU_matrix.h
===================================================================
--- branches/soc-2013-viewport_fx/source/blender/gpu/GPU_matrix.h	2013-07-17 11:41:44 UTC (rev 58336)
+++ branches/soc-2013-viewport_fx/source/blender/gpu/GPU_matrix.h	2013-07-17 11:44:01 UTC (rev 58337)
@@ -43,9 +43,6 @@
 void GPU_ms_init(void);
 void GPU_ms_exit(void);
 
-void gpuMatrixLock(void);
-void gpuMatrixUnlock(void);
-
 void gpuMatrixCommit(void);
 
 void gpuPushMatrix(void);
@@ -60,12 +57,14 @@
 void gpuLoadIdentity(void);
 
 void gpuMultMatrix(const GLfloat *m);
-void gpuMultMatrixd(const double *m);
+#if defined(WITH_GL_PROFILE_COMPATIBILITY) || defined(WITH_GL_PROFILE_CORE)
+void gpuMultMatrixd(const GLdouble *m);
+#endif
 
 void gpuTranslate(GLfloat x, GLfloat y, GLfloat z);
 void gpuScale(GLfloat x, GLfloat y, GLfloat z);
-void gpuRotateVector(GLfloat angle, GLfloat * vector);
-void gpuRotateAxis(GLfloat angle, char axis);
+void gpuRotateVector(GLfloat deg, GLfloat vector[3]);
+void gpuRotateAxis(GLfloat deg, char axis);
 void gpuRotateRight(char type);
 
 void gpuOrtho(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat nearVal, GLfloat farVal);
@@ -77,7 +76,7 @@
 void gpuLookAt(GLfloat eyeX, GLfloat eyeY, GLfloat eyeZ, GLfloat centerX, GLfloat centerY, GLfloat centerZ, GLfloat upX, GLfloat upY, GLfloat upZ);
 
 void gpuProject(const GLfloat obj[3], const GLfloat model[4][4], const GLfloat proj[4][4], const GLint view[4], GLfloat win[3]);
-int gpuUnProject(const GLfloat win[3], const GLfloat model[4][4], const GLfloat proj[4][4], const GLint view[4], GLfloat obj[3]);
+GLboolean gpuUnProject(const GLfloat win[3], const GLfloat model[4][4], const GLfloat proj[4][4], const GLint view[4], GLfloat obj[3]);
 
 
 #ifndef GPU_MAT_CAST_ANY

Modified: branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_deprecated.h
===================================================================
--- branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_deprecated.h	2013-07-17 11:41:44 UTC (rev 58336)
+++ branches/soc-2013-viewport_fx/source/blender/gpu/intern/gpu_deprecated.h	2013-07-17 11:44:01 UTC (rev 58337)
@@ -546,4 +546,65 @@
 #undef glRecti
 #define glRecti DO_NOT_USE_glRecti
 
+/* Matrixes */
+//#undef GL_MATRIX_MODE
+//#define GL_MATRIX_MODE DO_NOT_USE_GL_MATRIX_MODE
+//#undef GL_COLOR_MATRIX
+//#define GL_COLOR_MATRIX DO_NOT_USE_GL_COLOR_MATRIX
+//#undef GL_MODELVIEW_MATRIX
+//#define GL_MODELVIEW_MATRIX DO_NOT_USE_GL_MODELVIEW_MATRIX
+//#undef GL_PROJECTION_MATRIX
+//#define GL_PROJECTION_MATRIX DO_NOT_USE_GL_PROJECTION_MATRIX

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list