summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 420d49b)
raw | patch | inline | side by side (parent: 420d49b)
author | mental <mental@users.sourceforge.net> | |
Wed, 8 Feb 2006 04:23:31 +0000 (04:23 +0000) | ||
committer | mental <mental@users.sourceforge.net> | |
Wed, 8 Feb 2006 04:23:31 +0000 (04:23 +0000) |
ChangeLog | patch | blob | history | |
src/widgets/icon.cpp | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index 3b8ff6a85e337457c92538d2c77100c7c40a6d5d..79e1f51f1cf66e394e1dfde934bedcce5e216606 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2006-02-07 MenTaLguY <mental@rydia.net>
+
+ * src/widgets/icon.cpp: get rid of icon prerender time messages
+
2006-02-07 MenTaLguY <mental@rydia.net>
* src/debug/gc-heap.h, src/debug/logger.cpp, src/debug/sysv-heap.h,
diff --git a/src/widgets/icon.cpp b/src/widgets/icon.cpp
index 32ebb4c5798ed92702aa6f52aa21fcd464b2ae02..25f911d7d95be822eadc3fb6d987c66f95524ecb 100644 (file)
--- a/src/widgets/icon.cpp
+++ b/src/widgets/icon.cpp
static std::queue<preRenderItem> pendingRenders;
static bool callbackHooked = false;
-static Glib::Timer *prerender_timer=NULL;
static void addPreRender( GtkIconSize lsize, gchar const *name )
{
if ( !callbackHooked )
{
- g_message("Beginning icon prerendering");
- prerender_timer = new Glib::Timer();
callbackHooked = true;
g_idle_add_full( G_PRIORITY_LOW, &icon_prerender_task, NULL, NULL );
}
pendingRenders.push(preRenderItem(lsize, name));
}
-// in seconds; 10msec is roughly the threshold for human-perceptible lag,
-// but up to 60-70msec is tolerable
-#define INTERACTIVE_LIMIT 0.07
-
-static inline int seconds_to_msec(double seconds) {
- return (int)(seconds * 1000 + 0.5);
-}
-
gboolean icon_prerender_task(gpointer data) {
- Glib::Timer timer;
-
if (!pendingRenders.empty()) {
preRenderItem single=pendingRenders.front();
pendingRenders.pop();
int psize = sp_icon_get_phys_size(single._lsize);
prerender_icon(single._name.c_str(), single._lsize, psize);
-
- double elapsed=timer.elapsed();
- if ( elapsed > INTERACTIVE_LIMIT ) {
- g_warning("Prerendering of icon \"%s\" at %dx%d pixels exceeded %dmsec (%dmsec)", single._name.c_str(), psize, psize, seconds_to_msec(INTERACTIVE_LIMIT), seconds_to_msec(elapsed));
- }
}
if (!pendingRenders.empty()) {
return TRUE;
} else {
- prerender_timer->stop();
- g_message("Icon prerendering complete after %g seconds", prerender_timer->elapsed());
- delete prerender_timer;
- prerender_timer = NULL;
callbackHooked = false;
return FALSE;
}