[gtk: 6/7] Drop gdk_cairo_surface_upload_to_gl() helper
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk: 6/7] Drop gdk_cairo_surface_upload_to_gl() helper
- Date: Fri, 25 Sep 2020 14:53:21 +0000 (UTC)
commit a299bbfc58aadb75a416cc4abe9e95f5a59efe1f
Author: Alexander Larsson <alexl redhat com>
Date: Fri Sep 25 10:08:21 2020 +0200
Drop gdk_cairo_surface_upload_to_gl() helper
There is nothing really special about this code, its just a helper for
uploading pixel data to opengl, and we're not really in the business
of doing opengl-specific helper functions.
docs/reference/gdk/gdk4-sections.txt | 1 -
gdk/gdkcairo.h | 7 ------
gdk/gdkgl.c | 49 ------------------------------------
3 files changed, 57 deletions(-)
---
diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt
index 0bfe140b17..4c2b0dc3b2 100644
--- a/docs/reference/gdk/gdk4-sections.txt
+++ b/docs/reference/gdk/gdk4-sections.txt
@@ -300,7 +300,6 @@ gdk_cairo_rectangle
gdk_cairo_region
gdk_cairo_region_create_from_surface
gdk_cairo_draw_from_gl
-gdk_cairo_surface_upload_to_gl
</SECTION>
<SECTION>
diff --git a/gdk/gdkcairo.h b/gdk/gdkcairo.h
index e2dc85c41c..40ab46baf6 100644
--- a/gdk/gdkcairo.h
+++ b/gdk/gdkcairo.h
@@ -61,13 +61,6 @@ void gdk_cairo_draw_from_gl (cairo_t *cr,
int width,
int height);
-GDK_AVAILABLE_IN_ALL
-void gdk_cairo_surface_upload_to_gl (cairo_surface_t *surface,
- int target,
- int width,
- int height,
- GdkGLContext *context);
-
G_END_DECLS
#endif /* __GDK_CAIRO_H__ */
diff --git a/gdk/gdkgl.c b/gdk/gdkgl.c
index 2fe5cc863e..7ae8decfed 100644
--- a/gdk/gdkgl.c
+++ b/gdk/gdkgl.c
@@ -438,52 +438,3 @@ out:
if (clip_region)
cairo_region_destroy (clip_region);
}
-
-/**
- * gdk_cairo_surface_upload_to_gl:
- * @surface: a Cairo surface
- * @target: a GL texture target
- * @width: the width of the texture @target
- * @height: the height of the texture @target
- * @context: (nullable): a #GdkGLContext, or %NULL to use the currently
- * bound context
- *
- * Uploads the contents of a Cairo @surface to a GL texture @target.
- */
-void
-gdk_cairo_surface_upload_to_gl (cairo_surface_t *surface,
- int target,
- int width,
- int height,
- GdkGLContext *context)
-{
- cairo_rectangle_int_t rect;
- cairo_surface_t *tmp;
- double device_x_offset, device_y_offset;
-
- g_return_if_fail (surface != NULL);
- g_return_if_fail (context == NULL || GDK_IS_GL_CONTEXT (context));
-
- if (context == NULL)
- context = gdk_gl_context_get_current ();
-
- cairo_surface_flush (surface);
-
- cairo_surface_get_device_offset (surface, &device_x_offset, &device_y_offset);
-
- rect.x = (int) device_x_offset;
- rect.y = (int) device_y_offset;
- rect.width = width;
- rect.height = height;
- tmp = cairo_surface_map_to_image (surface, &rect);
-
- gdk_gl_context_upload_texture (context,
- cairo_image_surface_get_data (tmp),
- rect.width,
- rect.height,
- cairo_image_surface_get_stride (tmp),
- GDK_MEMORY_DEFAULT,
- target);
-
- cairo_surface_unmap_image (surface, tmp);
-}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]