summaryrefslogtreecommitdiff
path: root/gtk/gtkwindow.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2016-08-02 16:58:47 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2016-10-18 11:49:10 +0100
commit1ab1fd43910d256ac451ade32db8cf4ef2f7d10e (patch)
tree86884a8b915b1b9dd21fbdd8dc0f79a9c09a33ab /gtk/gtkwindow.c
parent6c92846936065e3cae8b815979531a3acebea037 (diff)
downloadgtk+-1ab1fd43910d256ac451ade32db8cf4ef2f7d10e.tar.gz
Use the projection to flip around the content
Since we use an FBO to render the contents of the render node tree, the coordinate space is going to be flipped in GL. We can undo the flip by using an appropriate projection matrix, instead of changing the sampling coordinates in the shaders and updating all our coordinates at render time.
Diffstat (limited to 'gtk/gtkwindow.c')
-rw-r--r--gtk/gtkwindow.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 786de023c5..4b10b409ff 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -161,6 +161,9 @@
* instead.
*/
+#define ORTHO_NEAR_PLANE -10000
+#define ORTHO_FAR_PLANE 10000
+
typedef struct _GtkWindowPopover GtkWindowPopover;
struct _GtkWindowPopover
@@ -446,8 +449,6 @@ static void gtk_window_real_activate_focus (GtkWindow *window);
static void gtk_window_keys_changed (GtkWindow *window);
static gboolean gtk_window_enable_debugging (GtkWindow *window,
gboolean toggle);
-static gint gtk_window_draw (GtkWidget *widget,
- cairo_t *cr);
static GskRenderNode *gtk_window_get_render_node (GtkWidget *widget,
GskRenderer *renderer);
static void gtk_window_unset_transient_for (GtkWindow *window);
@@ -7263,8 +7264,9 @@ _gtk_window_set_allocation (GtkWindow *window,
graphene_matrix_init_ortho (&projection,
0, allocation->width * scale,
- 0, allocation->height * scale,
- -1, 1);
+ allocation->height * scale, 0,
+ ORTHO_NEAR_PLANE,
+ ORTHO_FAR_PLANE);
gsk_renderer_set_projection (priv->renderer, &projection);
graphene_matrix_init_translate (&modelview,