diff options
Diffstat (limited to 'src/FbTk/ImageControl.hh')
-rw-r--r-- | src/FbTk/ImageControl.hh | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/FbTk/ImageControl.hh b/src/FbTk/ImageControl.hh index c43c5a0..29c43d6 100644 --- a/src/FbTk/ImageControl.hh +++ b/src/FbTk/ImageControl.hh | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: ImageControl.hh,v 1.4 2003/08/18 11:37:15 fluxgen Exp $ | 25 | // $Id: ImageControl.hh,v 1.5 2003/10/09 16:48:09 rathnor Exp $ |
26 | 26 | ||
27 | #ifndef FBTK_IMAGECONTROL_HH | 27 | #ifndef FBTK_IMAGECONTROL_HH |
28 | #define FBTK_IMAGECONTROL_HH | 28 | #define FBTK_IMAGECONTROL_HH |
@@ -34,6 +34,7 @@ | |||
34 | #include <X11/Xlib.h> | 34 | #include <X11/Xlib.h> |
35 | #include <X11/Xutil.h> | 35 | #include <X11/Xutil.h> |
36 | #include <list> | 36 | #include <list> |
37 | #include <set> | ||
37 | 38 | ||
38 | namespace FbTk { | 39 | namespace FbTk { |
39 | 40 | ||
@@ -114,9 +115,25 @@ private: | |||
114 | unsigned int count, width, height; | 115 | unsigned int count, width, height; |
115 | unsigned long pixel1, pixel2, texture; | 116 | unsigned long pixel1, pixel2, texture; |
116 | } Cache; | 117 | } Cache; |
118 | |||
119 | struct ltCacheEntry | ||
120 | { | ||
121 | bool operator()(const Cache* s1, const Cache* s2) const | ||
122 | { | ||
123 | return | ||
124 | (s1->width < s2->width || s1->width == s2->width && | ||
125 | (s1->height < s2->height || s1->height == s2->height && | ||
126 | (s1->texture < s2->texture || s1->texture == s2->texture && | ||
127 | s1->pixel1 < s2->pixel1 || s1->pixel1 == s2->pixel2 && | ||
128 | (s1->texture & FbTk::Texture::GRADIENT) && | ||
129 | s1->pixel2 < s2->pixel2) | ||
130 | )); | ||
131 | } | ||
132 | }; | ||
133 | |||
117 | 134 | ||
118 | unsigned long cache_max; | 135 | unsigned long cache_max; |
119 | typedef std::list<Cache *> CacheList; | 136 | typedef std::set<Cache *, ltCacheEntry> CacheList; |
120 | 137 | ||
121 | mutable CacheList cache; | 138 | mutable CacheList cache; |
122 | static bool s_timed_cache; | 139 | static bool s_timed_cache; |