[RFC weston 14/16] renderers: use weston_matrix_needs_filtering to choose filter parameters in gl and pixman renderers

Derek Foreman derekf at osg.samsung.com
Fri Sep 26 14:10:25 PDT 2014


Note: This causes a performance drop when zoomed under pixman.
---
 src/gl-renderer.c     | 6 +++---
 src/pixman-renderer.c | 5 +++--
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/gl-renderer.c b/src/gl-renderer.c
index f3aeff2..d42108d 100644
--- a/src/gl-renderer.c
+++ b/src/gl-renderer.c
@@ -560,9 +560,9 @@ draw_view(struct weston_view *ev, struct weston_output *output,
 
 	use_shader(gr, gs->shader);
 	shader_uniforms(gs->shader, ev, output);
-
-	if (ev->transform.enabled || output->zoom.active ||
-	    output->current_scale != ev->surface->buffer_viewport.buffer.scale)
+	if (ev->transform.enabled ||
+	    weston_matrix_needs_filtering(&output->matrix) ||
+	    weston_matrix_needs_filtering(&ev->surface->buffer_to_surface_matrix))
 		filter = GL_LINEAR;
 	else
 		filter = GL_NEAREST;
diff --git a/src/pixman-renderer.c b/src/pixman-renderer.c
index 2f54a64..22451da 100644
--- a/src/pixman-renderer.c
+++ b/src/pixman-renderer.c
@@ -161,7 +161,6 @@ repaint_region(struct weston_view *ev, struct weston_output *output,
 		(struct pixman_renderer *) output->compositor->renderer;
 	struct pixman_surface_state *ps = get_surface_state(ev->surface);
 	struct pixman_output_state *po = get_output_state(output);
-	struct weston_buffer_viewport *vp = &ev->surface->buffer_viewport;
 	pixman_region32_t final_region;
 	float view_x, view_y;
 	pixman_transform_t transform;
@@ -216,7 +215,9 @@ repaint_region(struct weston_view *ev, struct weston_output *output,
 	weston_matrix_to_pixman_transform(&transform, &matrix);
 	pixman_image_set_transform(ps->image, &transform);
 
-	if (ev->transform.enabled || output->current_scale != vp->buffer.scale)
+	if (ev->transform.enabled ||
+	    weston_matrix_needs_filtering(&output->matrix) ||
+	    weston_matrix_needs_filtering(&ev->surface->buffer_to_surface_matrix))
 		pixman_image_set_filter(ps->image, PIXMAN_FILTER_BILINEAR, NULL, 0);
 	else
 		pixman_image_set_filter(ps->image, PIXMAN_FILTER_NEAREST, NULL, 0);
-- 
2.1.0



More information about the wayland-devel mailing list