From 6968fb3123e69f563cd01d472967a9e6ddca2ec1 Mon Sep 17 00:00:00 2001
From: Ronan Pigott <rpigott@berkeley.edu>
Date: Wed, 13 Nov 2019 11:23:36 -0700
Subject: add scale_filter output config option

---
 include/sway/commands.h |  1 +
 include/sway/config.h   | 10 ++++++++++
 include/sway/output.h   |  1 +
 3 files changed, 12 insertions(+)

(limited to 'include')

diff --git a/include/sway/commands.h b/include/sway/commands.h
index 67665d87..5f249980 100644
--- a/include/sway/commands.h
+++ b/include/sway/commands.h
@@ -276,6 +276,7 @@ sway_cmd output_cmd_max_render_time;
 sway_cmd output_cmd_mode;
 sway_cmd output_cmd_position;
 sway_cmd output_cmd_scale;
+sway_cmd output_cmd_scale_filter;
 sway_cmd output_cmd_subpixel;
 sway_cmd output_cmd_toggle;
 sway_cmd output_cmd_transform;
diff --git a/include/sway/config.h b/include/sway/config.h
index ed542790..9a00ccb5 100644
--- a/include/sway/config.h
+++ b/include/sway/config.h
@@ -204,6 +204,13 @@ enum config_dpms {
 	DPMS_OFF
 };
 
+enum scale_filter_mode {
+	SCALE_FILTER_DEFAULT, // the default is currently smart
+	SCALE_FILTER_LINEAR,
+	SCALE_FILTER_NEAREST,
+	SCALE_FILTER_SMART
+};
+
 /**
  * Size and position configuration for a particular output.
  *
@@ -217,6 +224,7 @@ struct output_config {
 	int custom_mode;
 	int x, y;
 	float scale;
+	enum scale_filter_mode scale_filter;
 	int32_t transform;
 	enum wl_output_subpixel subpixel;
 	int max_render_time; // In milliseconds
@@ -655,6 +663,8 @@ int output_name_cmp(const void *item, const void *data);
 void output_get_identifier(char *identifier, size_t len,
 	struct sway_output *output);
 
+const char *sway_output_scale_filter_to_string(enum scale_filter_mode scale_filter);
+
 struct output_config *new_output_config(const char *name);
 
 void merge_output_config(struct output_config *dst, struct output_config *src);
diff --git a/include/sway/output.h b/include/sway/output.h
index ddc08022..bc03f4c5 100644
--- a/include/sway/output.h
+++ b/include/sway/output.h
@@ -32,6 +32,7 @@ struct sway_output {
 	int lx, ly; // layout coords
 	int width, height; // transformed buffer size
 	enum wl_output_subpixel detected_subpixel;
+	enum scale_filter_mode scale_filter;
 	// last applied mode when the output is DPMS'ed
 	struct wlr_output_mode *current_mode;
 
-- 
cgit v1.2.3