Changes to image draw method options
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 29 Apr 2013 15:50:12 +0000 (15:50 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 29 Apr 2013 15:50:12 +0000 (15:50 +0000)
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.

source/blender/editors/interface/resources.c
source/blender/editors/screen/glutil.c
source/blender/editors/space_sequencer/sequencer_draw.c
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesrna/intern/rna_userdef.c

index b4246fe5b9c992f7d8daed5c17d03d797fc14ed6..89469d47fbae22e8028de0ffd2ae1b4d3c521e68 100644 (file)
@@ -2187,6 +2187,9 @@ void init_userdef_do_versions(void)
        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 */
index 44d7c8d0114638306be7f61acd23d711dac0a92c..723dce5e22627ef882dbc3c7cefe4928626b5974 100644 (file)
@@ -1049,9 +1049,7 @@ void glaDrawImBuf_glsl(ImBuf *ibuf, float x, float y, int zoomfilter,
        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
index efda7554b33770ac979660c97b0247506d41e304..d1684e91bea68c4d7e023df61938620ccf05dcec 100644 (file)
@@ -1062,7 +1062,7 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq
        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) {
index c7aa6254bc740329ac9dba72b44047d7ee489b7c..7ed524f30ba3e38ce7eeacbff3fefb517f3b8199 100644 (file)
@@ -754,7 +754,7 @@ typedef enum eMultiSample_Type {
 } 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,
index 6376551665024f4187f3ef3b17b5c100c9324bb1..dc10c1b4aaedff3242973ed71a9184e9f8132272 100644 (file)
@@ -3375,9 +3375,8 @@ static void rna_def_userdef_system(BlenderRNA *brna)
 #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}
        };