summaryrefslogtreecommitdiff
path: root/gtk/gtkcssshadowsvalue.c
Commit message (Collapse)AuthorAgeFilesLines
* snapshot: Redo debug messagesBenjamin Otte2018-04-241-1/+1
| | | | | Instead of every snapshot function having debug messages, have an explicit gtk_snapshot_push_debug() function that appends a debug node.
* css: Introduce the idea of dynamic valuesBenjamin Otte2018-03-161-0/+2
| | | | | | | Dynamic values are values that change their contents with the current (monotonic) time. This just introduces the GtkCssValue API for it.
* css: Merge GtkStyleProviderPrivate into GtkStyleProviderBenjamin Otte2017-10-311-5/+5
| | | | | | | | This is just lots of renaming. The interface remains private, so the public API does not change, apart from removing the definition of the Interface object to avoid subclassing.
* Avoid creating trivial shadow nodesMatthias Clasen2017-10-281-0/+27
| | | | | | The Vulkan renderer creates a fallback surface for each shadow node, even if we end up not rendering anything to it. Avoiding this is a nice optimization.
* cssshadowsvalue: Don't heap-allocate shadowsTimm Bäder2017-10-011-13/+10
| | | | | | | This showed up in profiles in certain scenarios, so export a _get_n_shadows getter instead and let callers provide a sufficiently large allocated array of GskShadows, which we can use with g_alloc/g_newa.
* gsk: Add GskShadowNodeBenjamin Otte2016-12-201-0/+19
| | | | | | | ... and make the icon rendering code use it. This requires moving even more shadow renering code into GSK, but so be it. At least the "shadows not implemented" warning is now gone!
* gsk: Move gtk/gtkcairoblur.c to gsk/gskcairoblur.cBenjamin Otte2016-12-201-1/+0
|
* gtk: Remove GtkRoundedBox structBenjamin Otte2016-12-201-3/+3
| | | | Use GskRoundedRect instead.
* cssshadows: Fix extents computationBenjamin Otte2016-11-301-2/+5
| | | | Someody busted this code a *lot*.
* render: Propagate snapshot drawing to box shadowsBenjamin Otte2016-11-191-0/+36
| | | | | | | This decouples actual background drawing from shadow drawing in the snapshot case. We also now create seperate nodes for shadows vs for backgrounds.
* cssshadows: Reengineer APIBenjamin Otte2016-11-191-15/+3
| | | | | This way we have an API to query extents per shadow and I want that in the next patch.
* cssshadowsvalue: Avoid allocating new value if not neededBenjamin Otte2016-04-211-5/+26
|
* cssvalue: Remove GtkCssDependenciesBenjamin Otte2015-03-181-5/+2
| | | | They are not used anymore.
* css: Move scale to GtkStyleProviderPrivatewip/mir2Benjamin Otte2015-02-061-4/+3
| | | | | | This way, we can remove it as a separate argument from gtk_css_value_compute() and allow computation to only depend on one thing: the style provider.
* render: Remove spinner special-casesBenjamin Otte2015-01-201-16/+0
| | | | | | | | | The spinner is a regular builtin image now. There is no need to go through the shadows code manually anymore as regular items do get shadows automatically. This also allows simplifying the actual spinner drawing code so that it actually works.
* cssstyle: Rename GtkCssComputedValues => GtkCssStyleBenjamin Otte2015-01-071-2/+2
| | | | | This is literally just renaming of the object (and the associated source files). No other changes are in there.
* css: Round shadow extents properlyBenjamin Otte2014-08-211-4/+6
| | | | | | Otherwise drawing will be clipped. Testcase included
* css: Parse text-shadow values properlyBenjamin Otte2014-06-101-2/+3
| | | | | | We used to accept the same syntax for text-shadow and icon-shadow as we accept for box-shadow. However, box-shadow does accept a spread and the inset keyword while the others should not.
* css: Make getter function a real getterBenjamin Otte2014-05-231-0/+2
| | | | Initialize the passed-in value, don't treat it as an in-out parameter.
* themingengine: Draw "icon-shadow" on iconsBenjamin Otte2014-05-141-0/+8
|
* css: Fix computation of pixels occupied by blur radiusBenjamin Otte2014-02-031-5/+7
| | | | | | | | | 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: Add a scale argument to css-value compute vfuncAlexander Larsson2013-07-031-1/+2
| | | | | | | | 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.
* cssshadow: add a method to get the size of a shadows valueCosimo Cecchi2013-04-221-0/+34
| | | | The method returns the size of each side of a GtkCssShadowsValue.
* cds: enable outset shadowsChris Cummins2013-04-091-2/+4
| | | | | | | | | | 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>
* cssshadowsvalue: handle gtk_css_value_transition returning NULLCosimo Cecchi2012-10-161-10/+32
| | | | | | | | | | | | | | | The implementation of transition for GtkCssShadowValue can return NULL at least when the two values have a different inset; all other parts of the GTK/CSS machinery (e.g. GtkCssArrayValue) handle this by returning NULL too. Instead, GtkCssShadowsValue was returning an invalid value, where "len" was set, but some values in the array were NULL, which would lead to a segfault when this value is later evaluated by the compute function. Fix this by making GtkCssShadowsValue return NULL if a shadow transition fails, like GtkCssArrayValue does. https://bugzilla.gnome.org/show_bug.cgi?id=686013
* css: Huge refactoring to avoid computing wrong valuesBenjamin Otte2012-09-281-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* cssvalue: Pass property ID to transition functionBenjamin Otte2012-09-031-3/+4
| | | | | | | 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-3/+3
|
* css: Introduce dependencies for value computationsBenjamin Otte2012-08-281-4/+7
| | | | | | | | | 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: Pass property_id to compute functionBenjamin Otte2012-08-281-1/+2
| | | | | | | | | | | | | | | | 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-21/+20
| | | | | | | 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.
* shadow: Add equal and transition supportBenjamin Otte2012-04-171-2/+40
| | | | ... and enable transitions for the shadow properties.
* cssvalue: Add GtkCssShadowsValueBenjamin Otte2012-04-171-0/+234
This is necessary because shadows get treated differently from other lists when transitioning.