[gtk/flip-glarea] flip glarea back
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/flip-glarea] flip glarea back
- Date: Sun, 27 Sep 2020 16:33:43 +0000 (UTC)
commit fba425c9b6b7ef873f7892bb62d8b8da4f63cd29
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Sep 27 12:33:13 2020 -0400
flip glarea back
gtk/gtkglarea.c | 7 +++++++
1 file changed, 7 insertions(+)
---
diff --git a/gtk/gtkglarea.c b/gtk/gtkglarea.c
index 4cb815e1d9..884f7cad45 100644
--- a/gtk/gtkglarea.c
+++ b/gtk/gtkglarea.c
@@ -744,11 +744,18 @@ gtk_gl_area_snapshot (GtkWidget *widget,
texture->height,
release_texture, texture);
+ /* Our texture is backed by an FBO, and those are drawn upside-down,
+ * compared to screen buffer. Yay, OpenGL
+ */
+ gtk_snapshot_save (snapshot);
+ gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (0, gtk_widget_get_height (widget)));
+ gtk_snapshot_scale (snapshot, 1, -1);
gtk_snapshot_append_texture (snapshot,
texture->holder,
&GRAPHENE_RECT_INIT (0, 0,
gtk_widget_get_width (widget),
gtk_widget_get_height (widget)));
+ gtk_snapshot_restore (snapshot);
g_object_unref (texture->holder);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]