summaryrefslogtreecommitdiff
path: root/gtk/gtkcssshadowvalue.c
Commit message (Collapse)AuthorAgeFilesLines
* css: Fix computation of pixels occupied by blur radiusBenjamin Otte2014-02-031-6/+2
| | | | | | | | | 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
* css shadow: Fix memory leakPavel Vasin2013-08-311-0/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=706493
* css: Add a scale argument to css-value compute vfuncAlexander Larsson2013-07-031-5/+6
| | | | | | | | We need to be able to compute different GtkCssImage values depending on the scale, and we need this at compute time so that we don't need to read any images other than the scale in used (to e.g. calculate the image size). GtkStyleProviderPrivate is shared for all style contexts, so its not right.
* css shadow: Add extra slop to the blur clippingAlexander Larsson2013-05-061-31/+38
| | | | | | | Turns out our blurring function isn't very nice, it has a lot of energy past the blur radius, so clipping at exactly the blur radius causes ugly gradient stops. This just adds 4 extra pixels of slop, which makes this better in most cases.
* css shadows: Split up rendering of shadowsAlexander Larsson2013-05-061-4/+151
| | | | | | | We split up the rendering of blurred shadows into 9 parts, the corners, the sides and the rest. This lets us only blur the "blurry" part, and it lets us completely skip blurry parts that are fully clipped.
* css shadows: Exit early if clip is emptyAlexander Larsson2013-05-061-0/+18
|
* GtkCssShadowValue: Break out the shadow rendering codeAlexander Larsson2013-05-061-11/+22
| | | | | This makes it easier to call it multiple times which we want to do later.
* css: Clip outset box-shadow to outside of boxAlexander Larsson2013-05-061-6/+21
| | | | | | | | | | As per css3-background 7.2. Drop Shadows: the ‘box-shadow’ property: An outer box-shadow casts a shadow as if the border-box of the element were opaque. The shadow is drawn outside the border edge only: it is clipped inside the border-box of the element. Also verified vs firefox behaviour.
* cssshadow: add a method to get the size of a shadows valueCosimo Cecchi2013-04-221-0/+20
| | | | The method returns the size of each side of a GtkCssShadowsValue.
* cds: enable outset shadowsChris Cummins2013-04-091-4/+19
| | | | | | | | | | Adds conditional code paths to GdkCssShadowValue for painting outset shadows, and allows shadows to be applied in two passes (first outset then inset). This can be used to draw csd shadows in outer window borders. https://bugzilla.gnome.org/show_bug.cgi?id=695998 Signed-off-by: Rob Bradford <rob@linux.intel.com>
* cssvalue: Convert shadows to GtkCssColorValueBenjamin Otte2012-11-081-5/+3
|
* cssshadow: plug a cairo_surface_t leakCosimo Cecchi2012-10-161-0/+1
| | | | | | | We were never destroying the cairo surface we use for blurring, which would lead to a huge leak. https://bugzilla.gnome.org/show_bug.cgi?id=686209
* css: Huge refactoring to avoid computing wrong valuesBenjamin Otte2012-09-281-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Here's the shortest description of the bug I can come up with: When computing values, we have 3 kinds of dependencies: (1) other properties ("currentColor" or em values) (2) inherited properties ("inherit") (3) generic things from the theme (@keyframes or @define-color) Previously, we passed the GtkStyleContext as an argument, because it provided these 3 things using: (1) _gtk_style_context_peek_property() (2) _gtk_style_context_peek_property(gtk_style_context_get_parent()) (3) context->priv->cascade However, this makes it impossible to lookup values other than the ones accessible via _gtk_style_context_peek_property(). And this is exactly what we are doing in gtk_style_context_update_cache(). So when the cache updates encountered case (1), they were looking up the values from the wrong style data. So this large patch essentially does nothing but replace the context argument in all compute functions with new arguments for the 3 cases above: (1) values (2) parent_values (3) provider We apparently have a lot of computing code.
* Revert "blur: Use recording surface for capturing things to blur"Benjamin Otte2012-09-211-33/+12
| | | | | | | | This reverts commit f2cb8f12705ab3a36767df3430f8868ed7b29536. The patch actually didn't work for at least text. I currently have no clue why, but I suspect it requires investigating Cairo code and recording surfaces, and I'll not do that right now.
* blur: Use recording surface for capturing things to blurBenjamin Otte2012-09-201-12/+33
| | | | | This gets around clipping issues quite nicely and provides us with a (mostly theoretical) performance boost.
* shadow: add blur to icon-shadow (spinner)Andrea Cimitan2012-09-201-0/+4
|
* shadow: add blur to icon-shadow (icon)Andrea Cimitan2012-09-201-0/+5
|
* shadow: add blur to box-shadowAndrea Cimitan2012-09-201-4/+12
|
* shadow: add blur to text-shadowAndrea Cimitan2012-09-201-0/+5
|
* shadow: add code to render blurred shadowsCosimo Cecchi2012-09-201-0/+63
| | | | | | | | | | | | | | | Split out the blurred shadow rendering in three steps: - creation of a surface of the appropriate size - we use the clip rectangle as a good measurement for the size, since we won't render out of it anyway - painting the unblurred shape on the surface - this is responsibility of the single shadow implementations - blur the surface and compose the result back on the original cairo_t This means we can share code between the implementations for the first and third steps; it also makes the code independent of the rendered size, so we can avoid passing down a cairo_rectangle_t with e.g. the icon coordinates.
* cssvalue: Pass property ID to transition functionBenjamin Otte2012-09-031-5/+6
| | | | | | | This is to allow animating arrays properly. I'm not really thrilled about this solution (we leak propertys into the values again...), but it's the best I can come up with - I prefer it to having N different array types...
* css: Handle some more simple cases of dependenciesMatthias Clasen2012-08-281-8/+24
|
* css: Introduce dependencies for value computationsBenjamin Otte2012-08-281-8/+11
| | | | | | | | | When values are computed, they might depend on various other values and we need to track this so we can update the values when those other values change. This is the first step in making that happen. This patch does not do any dependency tracking at all, instead it uses GTK_CSS_DEPENDS_ON_EVERYTHING as a sort of FIXME.
* css: Fold color value computation into gtksymboliccolor.cBenjamin Otte2012-08-281-11/+1
| | | | | | | This gets rid of the public function _gtk_css_rgba_value_compute_from_symbolic(). The fallback is now handled using a switch statement instead of letting the caller pass the function.
* css: Pass property_id to compute functionBenjamin Otte2012-08-281-4/+5
| | | | | | | | | | | | | | | | This is a reorganization of how value computing should be done. Previously the GtkCssStyleProperty.compute vfunc was supposed to take care of special cases when it needed those for computation. However, this proved to be very complicated in cases where values were nested and only the last value (of a common type) needed to be special cased. A common example for this was the fallback handling for unresolvable colors. Now, we pass the property's ID along with all compute functions so we can do the special casing where it's necessary. Note that no actual changes happen in this commit. This will happen in follow-ups.
* css: Introduce _gtk_css_value_compute()Benjamin Otte2012-08-281-22/+23
| | | | | | | This commit is essentially a large reorganization. Instead of all value subtypes having their own compute function, there is the general _gtk_css_value_compute() function that then calls a vfunc on the subtype.
* cssshadow: plug a memory leakCosimo Cecchi2012-05-011-3/+4
|
* cssshadow: Default fallback color is transparentBenjamin Otte2012-05-011-2/+2
| | | | ... not the current color. Fixes unresolvable.ui test.
* symboliccolor: Treat it as a CssValueBenjamin Otte2012-04-171-7/+4
| | | | .. now that it is one.
* symboliccolor: Parse 'currentColor' everywhereBenjamin Otte2012-04-171-4/+1
|
* shadow: Add equal and transition supportBenjamin Otte2012-04-171-3/+37
| | | | ... and enable transitions for the shadow properties.
* shadow: Rewrite to store contents as valuesBenjamin Otte2012-04-171-87/+160
|
* shadow: Make color a GtkCssValueBenjamin Otte2012-04-171-31/+22
|
* cssvalue: Make GtkCssShadowValue only hold one shadowBenjamin Otte2012-04-171-253/+128
| | | | | | All the properties now are a GtkCssArrayValue of GtkCssSadowValue. GtkCssArrayValue already does everything we want, so no need to duplicate its funtionality.
* cssvalue: Add _gtk_css_value_transition()Benjamin Otte2012-04-171-0/+9
| | | | | | | Returns a value that transitions between start and end or %NULL if the values cannot be transitioned. So far, all implementations but numbers and rgba return NULL.
* shadow: Also rename filesBenjamin Otte2012-04-171-0/+411