[gtk+/master.fcw: 264/648] Revert "gdkgl: Optionally Use vfunc For Uploading Textures"



commit 9137d551d2c6d8858322f5df78bc66ef35649dc6
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed Dec 17 10:40:01 2014 +0800

    Revert "gdkgl: Optionally Use vfunc For Uploading Textures"
    
    This reverts commit 3fec50c716293f1240062d4dee95e53a2ee2e21e.

 gdk/gdkgl.c               |   16 +++++-----------
 gdk/gdkglcontextprivate.h |    5 -----
 2 files changed, 5 insertions(+), 16 deletions(-)
---
diff --git a/gdk/gdkgl.c b/gdk/gdkgl.c
index b1f7eb5..bc08bbc 100644
--- a/gdk/gdkgl.c
+++ b/gdk/gdkgl.c
@@ -720,17 +720,11 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
       e.height *= sy;
       image = cairo_surface_map_to_image (surface, &e);
 
-      /* We might have a different alignment, stride or format, so allow overriding here if needed */
-      if (GDK_GL_CONTEXT_GET_CLASS (paint_context)->upload_texture)
-        GDK_GL_CONTEXT_GET_CLASS (paint_context)->upload_texture (paint_context, image, e.width, e.height, 
target);
-      else
-        {
-          glPixelStorei (GL_UNPACK_ALIGNMENT, 4);
-          glPixelStorei (GL_UNPACK_ROW_LENGTH, cairo_image_surface_get_stride (image)/4);
-          glTexImage2D (target, 0, 4, e.width, e.height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
-                        cairo_image_surface_get_data (image));
-          glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
-        }
+      glPixelStorei (GL_UNPACK_ALIGNMENT, 4);
+      glPixelStorei (GL_UNPACK_ROW_LENGTH, cairo_image_surface_get_stride (image)/4);
+      glTexImage2D (target, 0, 4, e.width, e.height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
+                    cairo_image_surface_get_data (image));
+      glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
 
       cairo_surface_unmap_image (surface, image);
 
diff --git a/gdk/gdkglcontextprivate.h b/gdk/gdkglcontextprivate.h
index 612b79d..7f5f574 100644
--- a/gdk/gdkglcontextprivate.h
+++ b/gdk/gdkglcontextprivate.h
@@ -46,11 +46,6 @@ struct _GdkGLContextClass
   gboolean (* texture_from_surface) (GdkGLContext    *context,
                                      cairo_surface_t *surface,
                                      cairo_region_t  *region);
-  void (* upload_texture) (GdkGLContext    *context,
-                           cairo_surface_t *image_surface,
-                           int              width,
-                           int              height,
-                           guint            texture_target);
 };
 
 typedef struct {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]