summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Spitzak <spitzak@gmail.com>2016-03-06 17:06:57 -0800
committerSøren Sandmann Pedersen <soren.sandmann@gmail.com>2016-03-11 00:00:46 -0500
commitff6aee43664beab94299a3bf43c75a2f45d5c51e (patch)
tree4dc30ecfde4f0c902be5cd96d5f3f106a348aa7f
parent8a5e22b40318ce657e644c61102f161b503d5342 (diff)
demos/scale: Add good/best filter typesspitzak14
Allows testing them. Good is the default to match default behavior of pixman/cairo at startup. v14: Locked axis put in it's own commit Signed-off-by: Bill Spitzak <spitzak@gmail.com>
-rw-r--r--demos/scale.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/demos/scale.c b/demos/scale.c
index 0c6b533f..d1fce5d3 100644
--- a/demos/scale.c
+++ b/demos/scale.c
@@ -132,6 +132,8 @@ static const named_int_t filter_types[] =
{ "Separable", PIXMAN_FILTER_SEPARABLE_CONVOLUTION },
{ "Nearest", PIXMAN_FILTER_NEAREST },
{ "Bilinear", PIXMAN_FILTER_BILINEAR },
+ { "Good", PIXMAN_FILTER_GOOD },
+ { "Best", PIXMAN_FILTER_BEST },
};
static const named_int_t filters[] =
@@ -338,7 +340,7 @@ on_expose (GtkWidget *da, GdkEvent *event, gpointer data)
static void
set_up_combo_box (app_t *app, const char *box_name,
- int n_entries, const named_int_t table[])
+ int n_entries, const named_int_t table[], int active)
{
GtkWidget *widget = get_widget (app, box_name);
GtkListStore *model;
@@ -364,7 +366,7 @@ set_up_combo_box (app_t *app, const char *box_name,
gtk_list_store_set (model, &iter, 0, info->name, -1);
}
- gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
+ gtk_combo_box_set_active (GTK_COMBO_BOX (widget), active);
g_signal_connect (widget, "changed", G_CALLBACK (rescale), app);
}
@@ -372,7 +374,7 @@ set_up_combo_box (app_t *app, const char *box_name,
static void
set_up_filter_box (app_t *app, const char *box_name)
{
- set_up_combo_box (app, box_name, G_N_ELEMENTS (filters), filters);
+ set_up_combo_box (app, box_name, G_N_ELEMENTS (filters), filters, 0);
}
static char *
@@ -420,14 +422,14 @@ app_new (pixman_image_t *original)
widget = get_widget (app, "drawing_area");
g_signal_connect (widget, "expose_event", G_CALLBACK (on_expose), app);
- set_up_combo_box (app, "filter_combo_box", G_N_ELEMENTS (filter_types), filter_types);
+ set_up_combo_box (app, "filter_combo_box", G_N_ELEMENTS (filter_types), filter_types, 3);
set_up_filter_box (app, "reconstruct_x_combo_box");
set_up_filter_box (app, "reconstruct_y_combo_box");
set_up_filter_box (app, "sample_x_combo_box");
set_up_filter_box (app, "sample_y_combo_box");
set_up_combo_box (
- app, "repeat_combo_box", G_N_ELEMENTS (repeats), repeats);
+ app, "repeat_combo_box", G_N_ELEMENTS (repeats), repeats, 0);
g_signal_connect (
gtk_builder_get_object (app->builder, "lock_checkbutton"),