Commit Graph

9 Commits

Author SHA1 Message Date
Matthias Clasen
4654fa6efe bitmask: Trivial formatting fix 2015-09-12 11:24:37 -04:00
Matthias Clasen
c86f0b1b23 bitmask: Optimize no-op resizes
Statistics for the gtk3-demo listbox example show that the
vast majority of calls to _gtk_allocated_bitmask_resize go
from a size of 2 to 2. Don't needlessly call realloc() in
this case.
2015-09-12 11:24:37 -04:00
Matthias Clasen
0957ba5220 bitmask: Optimize intersect
The functions was written in a way that would possibly
resize the mask twice, which is not necessary.
2015-09-12 11:24:37 -04:00
Matthias Clasen
9cd302407f allocated bitmask: Use gtk_internal_return_if_fail 2015-09-08 08:07:33 -04:00
Benjamin Otte
c8c666c87c bitmask: Fix broken invert_range() implementation
The speed-up in 7da1f8a1ce was wrong in
certain conditions, even though it didn't trigger the existing
testsuite.

New testcase /bitmask/invert_range_hardcoded included.
2015-09-07 14:32:09 +02:00
Matthias Clasen
7da1f8a1ce Speed up gtk_allocated_bit_mask_invert_range
It was showing up on profiles and has a comment asking for speed.
2015-09-07 02:02:07 -04:00
Benjamin Otte
0ab48fcc42 css: Fix _gtk_bitmask_subtract()
We were doing the wrong thing *and* writing uninitialized memory while
doing so. BAD.

Also added tests exposing these.

https://bugzilla.redhat.com/show_bug.cgi?id=1185585
2015-02-25 01:55:28 +01:00
Neil Roberts
6044dfc35b bitmask: Don't allocate memory for small bitmasks
Code taken more or less verbatim from CoglBitmask.
2012-03-01 15:10:36 +01:00
Benjamin Otte
27eb83a410 bitmask: Split bitmask code into two
This does nothing but turn all GtkBitmask functions into static inline
functions that call the gtk_allocated_bitmask_*() equivalent.

The implementation of the static functions has also been put into a
private header, to not scare people who want to see how things are
implemented.
2012-03-01 15:10:36 +01:00