r51731 - in /desktop/unstable/gtk+3.0/debian: changelog patches/cssshadowvalue-scale-the-blur-surface-by-the-same-fa.patch patches/series
sjoerd at users.alioth.debian.org
sjoerd at users.alioth.debian.org
Thu Nov 10 21:58:43 UTC 2016
Author: sjoerd
Date: Thu Nov 10 21:58:43 2016
New Revision: 51731
URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=51731
Log:
* d/p/cssshadowvalue-scale-the-blur-surface-by-the-same-fa.patch
- Added. Improve the rendering of shadow around GTK windows, this turns out
to be a big performance improvement for HiDPI on wayland (From upstream
git, bgo#772075)
Added:
desktop/unstable/gtk+3.0/debian/patches/cssshadowvalue-scale-the-blur-surface-by-the-same-fa.patch
Modified:
desktop/unstable/gtk+3.0/debian/changelog
desktop/unstable/gtk+3.0/debian/patches/series
Modified: desktop/unstable/gtk+3.0/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gtk%2B3.0/debian/changelog?rev=51731&op=diff
==============================================================================
--- desktop/unstable/gtk+3.0/debian/changelog [utf-8] (original)
+++ desktop/unstable/gtk+3.0/debian/changelog [utf-8] Thu Nov 10 21:58:43 2016
@@ -1,3 +1,12 @@
+gtk+3.0 (3.22.3-2) UNRELEASED; urgency=medium
+
+ * d/p/cssshadowvalue-scale-the-blur-surface-by-the-same-fa.patch
+ - Added. Improve the rendering of shadow around GTK windows, this turns out
+ to be a big performance improvement for HiDPI on wayland (From upstream
+ git, bgo#772075)
+
+ -- Sjoerd Simons <sjoerd at debian.org> Thu, 10 Nov 2016 22:57:00 +0100
+
gtk+3.0 (3.22.3-1) unstable; urgency=medium
* New upstream release.
Added: desktop/unstable/gtk+3.0/debian/patches/cssshadowvalue-scale-the-blur-surface-by-the-same-fa.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gtk%2B3.0/debian/patches/cssshadowvalue-scale-the-blur-surface-by-the-same-fa.patch?rev=51731&op=file
==============================================================================
--- desktop/unstable/gtk+3.0/debian/patches/cssshadowvalue-scale-the-blur-surface-by-the-same-fa.patch (added)
+++ desktop/unstable/gtk+3.0/debian/patches/cssshadowvalue-scale-the-blur-surface-by-the-same-fa.patch [utf-8] Thu Nov 10 21:58:43 2016
@@ -0,0 +1,79 @@
+From 04f3940488bc9fc41c9239fc1533f0b8d78488d2 Mon Sep 17 00:00:00 2001
+From: Gustavo Noronha Silva <gustavo.noronha at collabora.co.uk>
+Date: Thu, 10 Nov 2016 16:13:47 -0200
+Subject: [PATCH] cssshadowvalue: scale the blur surface by the same factor as
+ the target
+
+Making sure the surfaces are using the same scale factor makes it more
+likely a fast path will be used when pixman gets involved, as pointed
+out by Benjamin Otte.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=772075
+---
+ gtk/gtkcssshadowvalue.c | 21 ++++++++++++++++-----
+ 1 file changed, 16 insertions(+), 5 deletions(-)
+
+diff --git a/gtk/gtkcssshadowvalue.c b/gtk/gtkcssshadowvalue.c
+index 35d3df7..6cdba7c 100644
+--- a/gtk/gtkcssshadowvalue.c
++++ b/gtk/gtkcssshadowvalue.c
+@@ -332,6 +332,7 @@ gtk_css_shadow_value_start_drawing (const GtkCssValue *shadow,
+ cairo_surface_t *surface;
+ cairo_t *blur_cr;
+ gdouble radius, clip_radius;
++ gdouble x_scale, y_scale;
+ gboolean blur_x = (blur_flags & GTK_BLUR_X) != 0;
+ gboolean blur_y = (blur_flags & GTK_BLUR_Y) != 0;
+
+@@ -343,6 +344,9 @@ gtk_css_shadow_value_start_drawing (const GtkCssValue *shadow,
+ radius = _gtk_css_number_value_get (shadow->radius, 0);
+ clip_radius = _gtk_cairo_blur_compute_pixels (radius);
+
++ x_scale = y_scale = 1;
++ cairo_surface_get_device_scale (cairo_get_target (cr), &x_scale, &y_scale);
++
+ if (blur_flags & GTK_BLUR_REPEAT)
+ {
+ if (!blur_x)
+@@ -354,11 +358,13 @@ gtk_css_shadow_value_start_drawing (const GtkCssValue *shadow,
+ /* Create a larger surface to center the blur. */
+ surface = cairo_surface_create_similar_image (cairo_get_target (cr),
+ CAIRO_FORMAT_A8,
+- clip_rect.width + (blur_x ? 2 * clip_radius : 0),
+- clip_rect.height + (blur_y ? 2 * clip_radius : 0));
++ x_scale * (clip_rect.width + (blur_x ? 2 * clip_radius : 0)),
++ y_scale * (clip_rect.height + (blur_y ? 2 * clip_radius : 0)));
++ cairo_surface_set_device_scale (surface, x_scale, y_scale);
+ cairo_surface_set_device_offset (surface,
+- (blur_x ? clip_radius : 0) - clip_rect.x,
+- (blur_y ? clip_radius : 0) - clip_rect.y);
++ x_scale * ((blur_x ? clip_radius: 0) - clip_rect.x),
++ y_scale * ((blur_y ? clip_radius * y_scale : 0) - clip_rect.y));
++
+ blur_cr = cairo_create (surface);
+ cairo_set_user_data (blur_cr, &original_cr_key, cairo_reference (cr), (cairo_destroy_func_t) cairo_destroy);
+
+@@ -395,6 +401,7 @@ gtk_css_shadow_value_finish_drawing (const GtkCssValue *shadow,
+ gdouble radius;
+ cairo_t *original_cr;
+ cairo_surface_t *surface;
++ gdouble x_scale;
+
+ if (!needs_blur (shadow))
+ return cr;
+@@ -404,7 +411,11 @@ gtk_css_shadow_value_finish_drawing (const GtkCssValue *shadow,
+ /* Blur the surface. */
+ surface = cairo_get_target (cr);
+ radius = _gtk_css_number_value_get (shadow->radius, 0);
+- _gtk_cairo_blur_surface (surface, radius, blur_flags);
++
++ x_scale = 1;
++ cairo_surface_get_device_scale (cairo_get_target (cr), &x_scale, NULL);
++
++ _gtk_cairo_blur_surface (surface, x_scale * radius, blur_flags);
+
+ gdk_cairo_set_source_rgba (original_cr, _gtk_css_rgba_value_get_rgba (shadow->color));
+ if (blur_flags & GTK_BLUR_REPEAT)
+--
+2.10.2
+
Modified: desktop/unstable/gtk+3.0/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gtk%2B3.0/debian/patches/series?rev=51731&op=diff
==============================================================================
--- desktop/unstable/gtk+3.0/debian/patches/series [utf-8] (original)
+++ desktop/unstable/gtk+3.0/debian/patches/series [utf-8] Thu Nov 10 21:58:43 2016
@@ -7,3 +7,4 @@
071_fix-installation-of-HTML-images.patch
no-accessibility-dump.patch
reftest-known-fail.patch
+cssshadowvalue-scale-the-blur-surface-by-the-same-fa.patch
More information about the pkg-gnome-commits
mailing list