| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
| |
http://www.viva64.com/en/b/0383/
|
|
|
|
|
|
| |
Use it instead of _gtk_css_parser_has_number().
We need that once we introduce calc() support.
|
|
|
|
|
|
|
|
|
|
| |
A lot of time was spend rendering the shadows on windows with CSD, in
particular the corner pieces, since they are the largest parts. This
patch catches this particular case and caches the pre-rendered blur
masks.
This makes the shadow code go from 25% to 8% of the time when resizing
gtk3-demo.
|
|
|
|
| |
This changes nothing, but makes the code a bit easier to read
|
|
|
|
| |
Fix warnings due to -Wdeclaration-after-statement and -Wshadow.
|
|
|
|
|
|
|
|
| |
Since these part really are the same in all of the x or y direction
and we don't blur in that direction we can just blur one line and
repeat it during drawing.
https://bugzilla.gnome.org/show_bug.cgi?id=746468
|
|
|
|
|
|
|
|
| |
There is no need to e.g. blur in the x-direction for the top part
of a box shadow. Also, there is no need to extend the mask in the
non-blurred direction.
https://bugzilla.gnome.org/show_bug.cgi?id=746468
|
|
|
|
|
|
|
|
|
|
|
|
| |
For radius 1px the current implementation rounds down to a 1 px box
filter which is a no-op. Rather than creating useless shadow masks
in this case we bail out blurring early.
Another alternative would be to make radius 1px round up to a 2 px box
filter, but that would change the rendering of Adwaita which is probably
not a great idea this late in the cycle.
https://bugzilla.gnome.org/show_bug.cgi?id=746468
|
|
|
|
| |
They are not used anymore.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
This is literally just renaming of the object (and the associated source
files). No other changes are in there.
|
|
|
|
|
|
|
|
|
| |
The shadow rendering code had code to exit early if we determine
that the shadow is entirely clipped away. Unfortunately, the check
based on cairo clip extents fails for any clip regions that are
more complicated than axis-aligned rectangles, and we are using
a hollow rounded rectangle here. So, instead, do the check manually,
using the just-introduced API in GtkRoundedBox.
|
|
|
|
| |
This is needed for cairo_set_device_scale()
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Drawing text with Pango is quite expensive, and drawing text and also
blurring it is *really* expensive. To prevent us from drawing a lot of
text and then blurring it a lot is *really* expensive.
We now cache the blurred pixels for the last layout and shadow we made,
which means we can repeatedly draw labels with a blurred text-shadow
extremely fast.
To detect whether the shadow is up-to-date, we track the serial of the
PangoLayout alongside the radius of the box shadow. We don't support
inset shadows nor spread on text-shadow, so we don't need to track
these.
|
|
|
|
|
|
| |
GtkThemingEngine just always calls
gtk_do_render_foo(engine->priv->context, ...)
now. Other than that, the code is unchanged.
|
|
|
|
| |
This makes it easier to update the check later.
|
|
|
|
|
|
| |
shadow_key is a poor name for this, and we're going to add more user
data keys, so rename it to something more indicative of what it's used
for.
|
|
|
|
|
|
| |
Calling this on an Xlib surface allows us to keep this in SHM memory,
giving it a potential speedup so we don't have to copy it to SHM memory
for the Composite when we mask later.
|
| |
|
|
|
|
| |
This is the place for wholly-deprecated sources.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It turns out that when we were painting the shadows, we painted the them
with the base color once, which contained the alpha, and then blurred it
and used it as a mask for the fill, which has the fill again.
To fix this, always paint the base surface with full alpha. The existing
code applies the blur conditionally sometimes in weird ways, so the code
shuffling fix may not look correct, but be assured it is. If the blur
happens, the new cr we return has the *default* color applied, which is
fully opaque black, which works perfectly against the A8 surface.
The fallback spinner code needs some modification, since it is
intentionally using the alpha to paint the lobes which are "in the past".
Since we shouldn't be hitting this fallback path very often, we use a
temporary group and paint it with paint_with_alpha, even though it is
slow.
|
|
|
|
| |
This is considerably faster to draw and paint.
|
|
|
|
|
| |
This will make it easier to use an A8 for our blurred surface instead of
a ARGB32, which makes things a lot easier and faster.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=706493
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
This makes it easier to call it multiple times which we
want to do later.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
The method returns the size of each side of a GtkCssShadowsValue.
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
This gets around clipping issues quite nicely and provides us with a
(mostly theoretical) performance boost.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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...
|