Always return false for GLES so that RGBA format will be used, 06/45106/2
authorsuyambu.rm <suyambu.rm@samsung.com>
Fri, 31 Jul 2015 12:34:09 +0000 (18:04 +0530)
committersuyambu.rm <suyambu.rm@samsung.com>
Mon, 3 Aug 2015 12:16:25 +0000 (17:46 +0530)
for tizen TV driver problem.

Workaround for mali driver when reading BGRA texture.
Should be removed once the driver issue is fixed.

Change-Id: I1de4866a14c2762e3d46c3010531c89aa8ff435f
Signed-off-by: suyambu.rm <suyambu.rm@samsung.com>
src/cairo-gl-device.c
src/cairo-gl-surface.c

index dbb6f16..53c76c1 100644 (file)
@@ -257,6 +257,10 @@ test_can_read_bgra (cairo_gl_context_t *ctx, cairo_gl_flavor_t gl_flavor)
 
     assert (gl_flavor == CAIRO_GL_FLAVOR_ES2 ||
            gl_flavor == CAIRO_GL_FLAVOR_ES3);
+    /* FIXME: always return false for GLES,  this is tizen TV driver problem.
+       Once that is resolved, we will return properly */
+
+    return FALSE;
 
    /* For OpenGL ES we have to look for the specific extension and BGRA only
     * matches cairo's integer packed bytes on little-endian machines. */
index 665ab24..a0b053b 100644 (file)
@@ -769,10 +769,7 @@ _create_scratch_internal (cairo_gl_context_t *ctx,
     default:
        ASSERT_NOT_REACHED;
     case CAIRO_CONTENT_COLOR_ALPHA:
-       if(ctx->can_read_bgra)
-           format = GL_BGRA;
-       else
-           format = GL_RGBA;
+       format = GL_RGBA;
        break;
     case CAIRO_CONTENT_ALPHA:
        /* When using GL_ALPHA, compositing doesn't work properly, but for
@@ -792,10 +789,7 @@ _create_scratch_internal (cairo_gl_context_t *ctx,
         * specified.  So, we have to store RGBA, and fill the alpha
         * channel with 1 when blending.
         */
-       if(ctx->can_read_bgra)
-           format = GL_BGRA;
-       else
-           format = GL_RGBA;
+       format = GL_RGBA;
        break;
     }
 
@@ -1228,10 +1222,8 @@ _cairo_gl_surface_draw_image (cairo_gl_surface_t *dst,
        pixman_format = _cairo_is_little_endian () ? PIXMAN_a8b8g8r8 : PIXMAN_r8g8b8a8;
 
        if (src->base.content != CAIRO_CONTENT_ALPHA) {
-           if (src->pixman_format != pixman_format) {
-               if (!ctx->can_read_bgra)
+           if (src->pixman_format != pixman_format)
                    require_conversion = TRUE;
-           }
        }
        else if (dst->base.content != CAIRO_CONTENT_ALPHA)
            require_conversion = TRUE;