[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56385] trunk/blender/source/blender: Changes to image draw method options

Sergey Sharybin sergey.vfx at gmail.com
Mon Apr 29 17:50:12 CEST 2013


Revision: 56385
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56385
Author:   nazgul
Date:     2013-04-29 15:50:12 +0000 (Mon, 29 Apr 2013)
Log Message:
-----------
Changes to image draw method options

It's now default to 2D textures, and no AUTO mode at this
moment, since detecting which method is the best not so
simple.

Image drawing could manually be switched to GLSL for tests
and feedback, but for default GLSL is not so much great.

Reason of this is huge images, where operations like panning
becomes dead slow comparing GLSL vs. 2D texture.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/resources.c
    trunk/blender/source/blender/editors/screen/glutil.c
    trunk/blender/source/blender/editors/space_sequencer/sequencer_draw.c
    trunk/blender/source/blender/makesdna/DNA_userdef_types.h
    trunk/blender/source/blender/makesrna/intern/rna_userdef.c

Modified: trunk/blender/source/blender/editors/interface/resources.c
===================================================================
--- trunk/blender/source/blender/editors/interface/resources.c	2013-04-29 15:02:54 UTC (rev 56384)
+++ trunk/blender/source/blender/editors/interface/resources.c	2013-04-29 15:50:12 UTC (rev 56385)
@@ -2187,6 +2187,9 @@
 	if (U.pixelsize == 0.0f)
 		U.pixelsize = 1.0f;
 	
+	if (U.image_draw_method == 0)
+		U.image_draw_method = IMAGE_DRAW_METHOD_2DTEXTURE;
+	
 	/* funny name, but it is GE stuff, moves userdef stuff to engine */
 // XXX	space_set_commmandline_options();
 	/* this timer uses U */

Modified: trunk/blender/source/blender/editors/screen/glutil.c
===================================================================
--- trunk/blender/source/blender/editors/screen/glutil.c	2013-04-29 15:02:54 UTC (rev 56384)
+++ trunk/blender/source/blender/editors/screen/glutil.c	2013-04-29 15:50:12 UTC (rev 56385)
@@ -1049,9 +1049,7 @@
 	force_fallback |= ibuf->channels == 1;
 
 	/* If user decided not to use GLSL, fallback to glaDrawPixelsAuto */
-	force_fallback |= !ELEM(U.image_draw_method,
-	                        IMAGE_DRAW_METHOD_AUTO,
-	                        IMAGE_DRAW_METHOD_GLSL);
+	force_fallback |= (U.image_draw_method != IMAGE_DRAW_METHOD_GLSL);
 
 	/* This is actually lots of crap, but currently not sure about
 	 * more clear way to bypass partial buffer update crappyness

Modified: trunk/blender/source/blender/editors/space_sequencer/sequencer_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_sequencer/sequencer_draw.c	2013-04-29 15:02:54 UTC (rev 56384)
+++ trunk/blender/source/blender/editors/space_sequencer/sequencer_draw.c	2013-04-29 15:50:12 UTC (rev 56385)
@@ -1062,7 +1062,7 @@
 	else {
 		bool force_fallback = false;
 
-		force_fallback |= !ELEM(U.image_draw_method, IMAGE_DRAW_METHOD_AUTO, IMAGE_DRAW_METHOD_GLSL);
+		force_fallback |= (U.image_draw_method != IMAGE_DRAW_METHOD_GLSL);
 		force_fallback |= (ibuf->dither != 0.0f);
 
 		if (force_fallback) {

Modified: trunk/blender/source/blender/makesdna/DNA_userdef_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_userdef_types.h	2013-04-29 15:02:54 UTC (rev 56384)
+++ trunk/blender/source/blender/makesdna/DNA_userdef_types.h	2013-04-29 15:50:12 UTC (rev 56385)
@@ -754,7 +754,7 @@
 } eMultiSample_Type;
 	
 typedef enum eImageDrawMethod {
-	IMAGE_DRAW_METHOD_AUTO = 0,
+	/* IMAGE_DRAW_METHOD_AUTO = 0, */ /* Currently unused */
 	IMAGE_DRAW_METHOD_GLSL = 1,
 	IMAGE_DRAW_METHOD_2DTEXTURE = 2,
 	IMAGE_DRAW_METHOD_DRAWPIXELS = 3,

Modified: trunk/blender/source/blender/makesrna/intern/rna_userdef.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_userdef.c	2013-04-29 15:02:54 UTC (rev 56384)
+++ trunk/blender/source/blender/makesrna/intern/rna_userdef.c	2013-04-29 15:50:12 UTC (rev 56385)
@@ -3375,9 +3375,8 @@
 #endif
 
 	static EnumPropertyItem image_draw_methods[] = {
-		{IMAGE_DRAW_METHOD_AUTO, "AUTO", 0, "Auto", "Try to detect best drawing method automatically"},
-		{IMAGE_DRAW_METHOD_GLSL, "GLSL", 0, "GLSL", "Use GLSL shaders for display transform and draw image with 2D texture"},
 		{IMAGE_DRAW_METHOD_2DTEXTURE, "2DTEXTURE", 0, "2D Texture", "Use CPU for display transform and draw image with 2D texture"},
+		{IMAGE_DRAW_METHOD_GLSL, "GLSL", 0, "GLSL", "Use GLSL shaders for display transform and draw image with 2D texture"},
 		{IMAGE_DRAW_METHOD_DRAWPIXELS, "DRAWPIXELS", 0, "DrawPixels", "Use CPU for display transform and draw image using DrawPixels"},
 		{0, NULL, 0, NULL, NULL}
 	};




More information about the Bf-blender-cvs mailing list