Commit Graph

16 Commits

Author SHA1 Message Date
Alexander Larsson
ae21e08782 gtkcairoblur: Minor restructure
This just moves get_box_filter_size to the top and makes
it a macro (so it can be used as a constant later).

https://bugzilla.gnome.org/show_bug.cgi?id=746468
2015-03-21 20:59:57 +01:00
Benjamin Otte
98ee594f73 blur: Simplify return_if_fail() 2015-02-05 18:57:29 +01:00
Jasper St. Pierre
5f40f58c36 cairoblur: Fix the blur again once more
The differences between the mutter and GTK+ code are subtle, but it
turns out that _gtk_cairo_blur_compute_pixels actually returns the
shadow *spread*. Since we use a triple box blur, the constant was
multiplied by 1.5 to approximate three chained box blurs. Split this
out and use the correct value for the lobe width.
2014-10-27 10:20:43 -07:00
Jasper St. Pierre
ac9ac55555 cairoblur: Fix the blur code
We weren't passing in the right "d" value, which was causing the blur to
behave incorrectly, especially in the case of 1px blurs, which would
cause no blurs at all.

The blur should now match the web.
2014-10-27 10:10:32 -07:00
Jasper St. Pierre
08f6dceef5 gtkcairoblur: Relicense under LGPL
Both Owen Taylor and I, the originators of this code, allow the code
herein be relicensed to the LGPL, which is what GTK+ ships with. This
prevents GTK+ from being GPL-only.
2014-08-31 19:50:37 -07:00
Matthias Clasen
1c34ad2668 Small comment fixups
One factual pointed out in the review in
https://bugzilla.gnome.org/show_bug.cgi?id=734053, plus some
formatting nit picks.
2014-08-03 00:42:48 +02:00
Jasper St. Pierre
f5d8f75c0f gtkcairoblur: Replace our exponential blur with the box blur from mutter
https://bugzilla.gnome.org/show_bug.cgi?id=734053
2014-08-03 00:35:55 +02:00
Jasper St. Pierre
45bdec84f5 gtkcairoblur: Blur a CAIRO_A8 surface instead of a full CAIRO_ARGB32
This is considerably faster to draw and paint.
2014-07-29 10:49:39 +02:00
William Jon McCann
13998c55e7 docs: use proper quotations instead of '*' 2014-02-07 14:22:39 -05:00
Benjamin Otte
e9fb8ad1f7 css: Fix computation of pixels occupied by blur radius
These computations were done randomly in lots of places and more often
than not, they were also wrong.
This function was copied (with docs) from Firefox:
  http://lxr.mozilla.org/mozilla-central/source/gfx/2d/Blur.cpp

https://bugzilla.gnome.org/show_bug.cgi?id=723159
2014-02-03 21:38:16 +01:00
Benjamin Otte
a239f2e8b0 blur: Do the same thing for rows and cols 2012-09-20 02:45:41 +02:00
Benjamin Otte
502a2bf625 blur: Use rowstride 2012-09-20 02:45:41 +02:00
Benjamin Otte
65ba8901aa blur: Simplify code
It's always the same code, so there's no need for switch statements.
2012-09-20 02:45:41 +02:00
Benjamin Otte
267d1793c6 blur: Fix pixel sizes
The code accesses pixels in a chunks of 4 bytes, so we must only support
formats where the size of a single pixel is 4 bytes.
Fix RGB24 to be 4 bytes (the alpha channel is ignored) and disallow A8.
2012-09-20 02:45:41 +02:00
Benjamin Otte
1cecaf6d7e blur: Take the radius as a double parameter
It's only ever used like that
2012-09-20 02:45:41 +02:00
Andrea Cimitan
43673dafdc Add code for blurring (original code from Unico, copyright fine for Gtk+) 2012-09-20 02:45:41 +02:00