Evas GL : Bugfix when using pixmap in native surface image 43/37943/2
authorDaekwang Ryu <dkdk.ryu@samsung.com>
Wed, 8 Apr 2015 14:19:20 +0000 (23:19 +0900)
committerDaekwang Ryu <dkdk.ryu@samsung.com>
Thu, 9 Apr 2015 04:39:53 +0000 (13:39 +0900)
[Cause] When using pixmap without alpha channel, use incorrect shader codes.
[Solution] add a new variable "offbuffer"

Change-Id: Ia98b14b52658e8654efd1d493a88ea31145769a6

src/modules/evas/engines/gl_common/evas_gl_common.h
src/modules/evas/engines/gl_common/evas_gl_context.c
src/modules/evas/engines/gl_x11/evas_engine.c

index 7d3c1d3..f05e42a 100644 (file)
@@ -590,6 +590,8 @@ struct _Evas_GL_Image
       int           target;
       int           mipmap;
       unsigned char loose : 1;
+      //Tizen Only
+      unsigned char    offbuffer : 1;
    } native;
 
    int scale_hint, content_hint;
index 51eff90..9fb8be5 100644 (file)
@@ -1841,7 +1841,8 @@ evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc,
                }
              else
                {
-                  if ((!tex->alpha) && (tex->pt->native))
+                  //Tizen Only  : (!tex->im->native.offbuffer)
+                  if ((!tex->alpha) && (tex->pt->native) && (!tex->im->native.offbuffer))
                     shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
                                                           SHADER_TEX_NOMUL_AFILL, SHADER_TEX_AFILL,
                                                           SHADER_IMG_MASK_NOMUL, SHADER_IMG_MASK);
index 3d6f45c..7467045 100644 (file)
@@ -2188,6 +2188,8 @@ eng_image_native_set(void *data, void *image, void *native)
               im->native.func.free   = _native_free_cb;
               im->native.target      = GL_TEXTURE_2D;
               im->native.mipmap      = 0;
+              //Tizen Only
+              im->native.offbuffer   = 1;
               glsym_evas_gl_common_image_native_enable(im);
             }
         }
@@ -2393,7 +2395,9 @@ eng_image_native_set(void *data, void *image, void *native)
                       im->native.func.bind   = _native_bind_cb;
                       im->native.func.unbind = _native_unbind_cb;
                       im->native.func.free   = _native_free_cb;
-                      
+                      //Tizen Only
+                      im->native.offbuffer   = 0;
+
                       glsym_evas_gl_common_image_native_enable(im);
                    }
               }
@@ -2430,6 +2434,8 @@ eng_image_native_set(void *data, void *image, void *native)
               im->native.func.free   = _native_free_cb;
               im->native.target      = GL_TEXTURE_2D;
               im->native.mipmap      = 0;
+              //Tizen Only
+              im->native.offbuffer   = 0;
 
               // FIXME: need to implement mapping sub texture regions
               // x, y, w, h for possible texture atlasing