aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/ImageControl.cc
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-01-18 08:33:47 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-01-18 08:33:47 (GMT)
commit1d4bea8a2db2c0ab1e14b8afd81c87b80a262d66 (patch)
tree21cc4e919cabe52ab8d355a7ceec980da6fb420a /src/FbTk/ImageControl.cc
parent3a5fd7342d6cfd00acafeec4c1f35948a550e4ab (diff)
parent8c2cee577a744870fd497f73a21c2d4e1c45c907 (diff)
downloadfluxbox_paul-1d4bea8a2db2c0ab1e14b8afd81c87b80a262d66.zip
fluxbox_paul-1d4bea8a2db2c0ab1e14b8afd81c87b80a262d66.tar.bz2
Merge branch 'master' of fluxbox@gitfbox:fluxbox
Diffstat (limited to 'src/FbTk/ImageControl.cc')
-rw-r--r--src/FbTk/ImageControl.cc23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/FbTk/ImageControl.cc b/src/FbTk/ImageControl.cc
index 1281b56..1fa2f65 100644
--- a/src/FbTk/ImageControl.cc
+++ b/src/FbTk/ImageControl.cc
@@ -25,6 +25,7 @@
25#include "ImageControl.hh" 25#include "ImageControl.hh"
26 26
27#include "TextureRender.hh" 27#include "TextureRender.hh"
28#include "Texture.hh"
28#include "App.hh" 29#include "App.hh"
29#include "SimpleCommand.hh" 30#include "SimpleCommand.hh"
30#include "I18n.hh" 31#include "I18n.hh"
@@ -67,15 +68,17 @@ using std::list;
67 68
68namespace FbTk { 69namespace FbTk {
69 70
70// lookup table for texture 71namespace { // anonymous
71unsigned long *ImageControl::sqrt_table = 0; 72
73static unsigned long *sqrt_table = 0; /// lookup table
74
72#ifdef TIMEDCACHE 75#ifdef TIMEDCACHE
73bool ImageControl::s_timed_cache = true; 76bool s_timed_cache = true;
74#else 77#else
75bool ImageControl::s_timed_cache = false; 78bool s_timed_cache = false;
76#endif // TIMEDCACHE 79#endif // TIMEDCACHE
77 80
78namespace { // anonymous 81
79 82
80inline unsigned long bsqrt(unsigned long x) { 83inline unsigned long bsqrt(unsigned long x) {
81 if (x <= 0) return 0; 84 if (x <= 0) return 0;
@@ -93,6 +96,14 @@ inline unsigned long bsqrt(unsigned long x) {
93 96
94}; // end anonymous namespace 97}; // end anonymous namespace
95 98
99struct ImageControl::Cache {
100 Pixmap pixmap;
101 Pixmap texture_pixmap;
102 Orientation orient;
103 unsigned int count, width, height;
104 unsigned long pixel1, pixel2, texture;
105};
106
96ImageControl::ImageControl(int screen_num, bool dither, 107ImageControl::ImageControl(int screen_num, bool dither,
97 int cpc, unsigned long cache_timeout, unsigned long cmax): 108 int cpc, unsigned long cache_timeout, unsigned long cmax):
98 m_dither(dither), 109 m_dither(dither),
@@ -148,7 +159,7 @@ ImageControl::~ImageControl() {
148 delete [] m_colors; 159 delete [] m_colors;
149 } 160 }
150 161
151 if (cache.size() > 0) { 162 if (!cache.empty()) {
152 CacheList::iterator it = cache.begin(); 163 CacheList::iterator it = cache.begin();
153 CacheList::iterator it_end = cache.end(); 164 CacheList::iterator it_end = cache.end();
154 for (; it != it_end; ++it) { 165 for (; it != it_end; ++it) {