Ryan Lortie [Mon, 16 Apr 2012 13:34:30 +0000 (09:34 -0400)]
./configure: fix error output for no -libXext
Due to the way the tests are structured, a missing libXext will give a
warning about a missing libX11 (even if libX11 is installed). This is
confusing to people who are trying to build Gtk.
messagedialog: also set GtkMisc alignment to zero for dialog labels
Setting xalign to START is not enough to make them left-aligned in every
case. This fixes a regression introduced in commit cc0be1f949020de1562534fbc31ddf0af4651fe2
messagedialog: don't use gtk_widget_override_font()
Instead of overriding the font theme settings, just set the Pango
attributes we want on the label. This fixes message dialogs growing on
style_update after recent GTK+ changes.
Benjamin Otte [Fri, 13 Apr 2012 15:27:47 +0000 (17:27 +0200)]
container: Redo style validation handling
Instead of using 1 global queue for both resizes and style validation,
use 2 queues. This makes the code a lot simpler and fixes a bug where we
could accidentally stop restylying for very delayed restyles.
Benjamin Otte [Wed, 11 Apr 2012 14:27:38 +0000 (16:27 +0200)]
stylecontext: Pull all the animation code together
We now animate the core style information (see comment in
gtk_style_context_save()). A lot of widgets save + set custom style
classes/states during drawing and so can't be animated. It does work for
labels, menus and buttons though.
Benjamin Otte [Wed, 11 Apr 2012 14:15:45 +0000 (16:15 +0200)]
stylecontext: Add GtkCssAnimatedValues
This is a GtkCssComputedValues subclass. So it's essentially a store for
computed CSS values. But it can be animated by advancing it to a certain
timestamp.
Benjamin Otte [Wed, 11 Apr 2012 14:00:57 +0000 (16:00 +0200)]
stylecontext: Add new class for animation handling
A StyleAnimation is an immutable object used to track the state of CSS
values. I'd have liked to make it fully immutable - ie not have the
timestamp in there - but couldn't find a place to sanely store the
timestamp.
This is an abstract base class. Implementations for this will be added
later (for both CSS3 transitions and animations, potentially for
animated images).
Actually aplying the information in this object will be done by a
different object commtted later.
Benjamin Otte [Tue, 10 Apr 2012 13:37:35 +0000 (15:37 +0200)]
stylecontext: Add an animating framework
The design principles were:
- synchronized
If multiple style contexts are animating, they should all do an
animation step at the same time.
- degrades well
Even when there's thousands of style contexts all animating at the same
time, the animation steps don't starve the CPU. This is achieved by
making sure the timeout is really fast. It just sets a bunch of flags.
- no hidden bottlenecks
Turning animatability on or off on a style context is O(1).
Benjamin Otte [Sat, 7 Apr 2012 16:09:17 +0000 (18:09 +0200)]
stylecontext: Compute if things changed before invalidating
This is only a small performance boost by itself, but it's necessary
for animations, so we need it.
Benchmark numbers for my Glade benchmark for interested people:
GTK 3.4.0 last commit this commit
Raleigh
real 0m41.879s 0m10.176s 0m9.900s
user 0m41.394s 0m9.895s 0m9.628s
sys 0m0.111s 0m0.096s 0m0.102s
Adwaita (*)
real 0m51.049s 0m13.432s 0m14.848s 0m12.253s
user 0m50.487s 0m13.034s 0m13.218s 0m11.927s
sys 0m0.117s 0m0.151s 0m0.147s 0m0.107s
Ambiance (patched to not use private GTK APIs)
real 0m52.167s 0m13.115s 0m13.117s 0m12.944s
user 0m51.576s 0m12.739s 0m12.768s 0m12.651s
sys 0m0.119s 0m0.137s 0m0.136s 0m0.118s
(*) Adwaita and unico currently use custom properties, and
_gtk_css_value_compare() for custom properties always returns FALSE,
which makes this optimization never trigger. So I modified
_gtk_css_value_compare() to return TRUE for these properties instead and
reran the benchmark. Those are the numbers.
Benjamin Otte [Sat, 7 Apr 2012 12:15:35 +0000 (14:15 +0200)]
widget: Don't cache widget paths all the time
Add an internal API that allows GtkStyleContext to create a widget path
for the widget and with that bypassing gtk_widget_get_path() and that
function caching the path.
Benjamin Otte [Sat, 7 Apr 2012 05:40:36 +0000 (07:40 +0200)]
cssvalue: Split out old value handling to new typed value
... and Make this new value be a real GValue, as we don't need to save
performance for these anymore (it's just used for custom properties).
And I'd rather have code work for all values then be optimized for no
reason.
Benjamin Otte [Tue, 3 Apr 2012 17:11:41 +0000 (19:11 +0200)]
cssstyleproperty: Convert binding sets
Instead of keeping a custom GPtrArray, keep it as a GtkCssArrayValue of
GtkCssStringValue. This way, we gain equality comparisons and print
functions for free.
Benjamin Otte [Tue, 3 Apr 2012 09:49:46 +0000 (11:49 +0200)]
cssvalue: Make GtkCssShadowValue only hold one shadow
All the properties now are a GtkCssArrayValue of GtkCssSadowValue.
GtkCssArrayValue already does everything we want, so no need to
duplicate its funtionality.
Benjamin Otte [Mon, 2 Apr 2012 21:28:37 +0000 (23:28 +0200)]
stylecontext: Don't queue_resize() all the time
When a parent style context exists, there's no need to queue_resize() on
the widget, because the parent widget will call
gtk_style_context_validate() on us and _then_ we can call queue_resize()
if we have to.
Benjamin Otte [Mon, 2 Apr 2012 07:16:08 +0000 (09:16 +0200)]
cssstyleproperty: Mark all animatable properties
Only the ones that can be animated are marked of course. So more work is
needed.
This is important for
transition-property: all;
because it'll just animate all the properties that can be.