diff options
author | Alexander Larsson <alexl@redhat.com> | 2014-10-09 11:16:51 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-10-13 10:43:31 -0400 |
commit | 5d7e268aac476c76b924e6290469dc1ba6ee718b (patch) | |
tree | 37deefd89734c0a00db999efefa3547e6980931d | |
parent | 8f3e9d1b05a635c078e1224f03139135da3aaa2b (diff) | |
download | gtk+-5d7e268aac476c76b924e6290469dc1ba6ee718b.tar.gz |
Add tests/testglblending
This test stacks GL and cairo rendering in various
orders to test the layer handling.
-rw-r--r-- | tests/Makefile.am | 6 | ||||
-rw-r--r-- | tests/testglblending.c | 94 |
2 files changed, 100 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 7384a22856..b6a60996c5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -70,6 +70,7 @@ noinst_PROGRAMS = $(TEST_PROGS) \ testgeometry \ testgiconpixbuf \ testglarea \ + testglblending \ testgrid \ testgtk \ testheaderbar \ @@ -507,6 +508,11 @@ gdkgears_SOURCES = \ gtkgears.c \ gtkgears.h +testglblending_SOURCES = \ + testglblending.c \ + gtkgears.c \ + gtkgears.h + EXTRA_DIST += \ gradient1.png \ testgtk.1 \ diff --git a/tests/testglblending.c b/tests/testglblending.c new file mode 100644 index 0000000000..ef81c8c52b --- /dev/null +++ b/tests/testglblending.c @@ -0,0 +1,94 @@ +#include <stdlib.h> +#include <gtk/gtk.h> + +#include "gtkgears.h" + +int +main (int argc, char *argv[]) +{ + GtkWidget *window, *fixed, *gears, *spinner; + + gtk_init (&argc, &argv); + + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW (window), "Test GL/gtk inter-blending"); + gtk_window_set_default_size (GTK_WINDOW (window), 250, 250); + gtk_container_set_border_width (GTK_CONTAINER (window), 12); + g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL); + + fixed = gtk_fixed_new (); + gtk_container_add (GTK_CONTAINER (window), fixed); + + spinner = gtk_spinner_new (); + gtk_spinner_start (GTK_SPINNER (spinner)); + gtk_widget_set_size_request (spinner, 50, 50); + gtk_fixed_put (GTK_FIXED (fixed), spinner, 90, 80); + + spinner = gtk_spinner_new (); + gtk_spinner_start (GTK_SPINNER (spinner)); + gtk_widget_set_size_request (spinner, 50, 50); + gtk_fixed_put (GTK_FIXED (fixed), spinner, 100, 80); + + spinner = gtk_spinner_new (); + gtk_spinner_start (GTK_SPINNER (spinner)); + gtk_widget_set_size_request (spinner, 50, 50); + gtk_fixed_put (GTK_FIXED (fixed), spinner, 110, 80); + + + gears = gtk_gears_new (); + gtk_widget_set_size_request (gears, 70, 50); + gtk_fixed_put (GTK_FIXED (fixed), gears, 60, 100); + + gears = gtk_gears_new (); + gtk_gl_area_set_has_alpha (GTK_GL_AREA (gears), TRUE); + gtk_widget_set_size_request (gears, 70, 50); + gtk_fixed_put (GTK_FIXED (fixed), gears, 120, 100); + + + spinner = gtk_spinner_new (); + gtk_spinner_start (GTK_SPINNER (spinner)); + gtk_widget_set_size_request (spinner, 50, 50); + gtk_fixed_put (GTK_FIXED (fixed), spinner, 90, 110); + + spinner = gtk_spinner_new (); + gtk_spinner_start (GTK_SPINNER (spinner)); + gtk_widget_set_size_request (spinner, 50, 50); + gtk_fixed_put (GTK_FIXED (fixed), spinner, 100, 110); + + spinner = gtk_spinner_new (); + gtk_spinner_start (GTK_SPINNER (spinner)); + gtk_widget_set_size_request (spinner, 50, 50); + gtk_fixed_put (GTK_FIXED (fixed), spinner, 110, 110); + + + gears = gtk_gears_new (); + gtk_widget_set_size_request (gears, 70, 50); + gtk_fixed_put (GTK_FIXED (fixed), gears, 60, 130); + + gears = gtk_gears_new (); + gtk_gl_area_set_has_alpha (GTK_GL_AREA (gears), TRUE); + gtk_widget_set_size_request (gears, 70, 50); + gtk_fixed_put (GTK_FIXED (fixed), gears, 120, 130); + + + spinner = gtk_spinner_new (); + gtk_spinner_start (GTK_SPINNER (spinner)); + gtk_widget_set_size_request (spinner, 50, 50); + gtk_fixed_put (GTK_FIXED (fixed), spinner, 90, 150); + + spinner = gtk_spinner_new (); + gtk_spinner_start (GTK_SPINNER (spinner)); + gtk_widget_set_size_request (spinner, 50, 50); + gtk_fixed_put (GTK_FIXED (fixed), spinner, 100, 150); + + spinner = gtk_spinner_new (); + gtk_spinner_start (GTK_SPINNER (spinner)); + gtk_widget_set_size_request (spinner, 50, 50); + gtk_fixed_put (GTK_FIXED (fixed), spinner, 110, 150); + + gtk_widget_show_all (window); + + gtk_main (); + + return EXIT_SUCCESS; +} |