summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatertexturefetchdebugger.cpp
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2012-05-03 11:38:05 -0600
committerXiaohong Bao <bao@lindenlab.com>2012-05-03 11:38:05 -0600
commite65852e9a58ec92763b88369f53092628ab7a6b8 (patch)
treef7ba9763d15aa9b6c9963e1fdc72dcb2904ca542 /indra/newview/llfloatertexturefetchdebugger.cpp
parent78fec489b53434a8ac8f9c0a8e72fd883067ce42 (diff)
For SH-3086: add functions to refetch all previous textures through HTTP and from cache
Diffstat (limited to 'indra/newview/llfloatertexturefetchdebugger.cpp')
-rw-r--r--indra/newview/llfloatertexturefetchdebugger.cpp91
1 files changed, 81 insertions, 10 deletions
diff --git a/indra/newview/llfloatertexturefetchdebugger.cpp b/indra/newview/llfloatertexturefetchdebugger.cpp
index 2b34b72055..b6210423d1 100644
--- a/indra/newview/llfloatertexturefetchdebugger.cpp
+++ b/indra/newview/llfloatertexturefetchdebugger.cpp
@@ -59,6 +59,8 @@ LLFloaterTextureFetchDebugger::LLFloaterTextureFetchDebugger(const LLSD& key)
mCommitCallbackRegistrar.add("TexFetchDebugger.RefetchVisCache", boost::bind(&LLFloaterTextureFetchDebugger::onClickRefetchVisCache, this));
mCommitCallbackRegistrar.add("TexFetchDebugger.RefetchVisHTTP", boost::bind(&LLFloaterTextureFetchDebugger::onClickRefetchVisHTTP, this));
+ mCommitCallbackRegistrar.add("TexFetchDebugger.RefetchAllCache", boost::bind(&LLFloaterTextureFetchDebugger::onClickRefetchAllCache, this));
+ mCommitCallbackRegistrar.add("TexFetchDebugger.RefetchAllHTTP", boost::bind(&LLFloaterTextureFetchDebugger::onClickRefetchAllHTTP, this));
}
//----------------------------------------------
@@ -76,8 +78,10 @@ BOOL LLFloaterTextureFetchDebugger::postBuild(void)
mButtonStateMap["decode_btn"] = false;
mButtonStateMap["gl_btn"] = false;
- mButtonStateMap["refetchviscache_btn"] = true;
- mButtonStateMap["refetchvishttp_btn"] = true;
+ mButtonStateMap["refetchviscache_btn"] = false;
+ mButtonStateMap["refetchvishttp_btn"] = false;
+ mButtonStateMap["refetchallcache_btn"] = false;
+ mButtonStateMap["refetchallhttp_btn"] = false;
updateButtons();
@@ -118,6 +122,8 @@ void LLFloaterTextureFetchDebugger::disableButtons()
childDisable("gl_btn");
childDisable("refetchviscache_btn");
childDisable("refetchvishttp_btn");
+ childDisable("refetchallcache_btn");
+ childDisable("refetchallhttp_btn");
}
void LLFloaterTextureFetchDebugger::idle()
@@ -130,8 +136,7 @@ void LLFloaterTextureFetchDebugger::idle()
{
case LLTextureFetchDebugger::IDLE:
break;
- case LLTextureFetchDebugger::READ_CACHE:
- mButtonStateMap["cachewrite_btn"] = true;
+ case LLTextureFetchDebugger::READ_CACHE:
mButtonStateMap["decode_btn"] = true;
updateButtons();
break;
@@ -156,6 +161,11 @@ void LLFloaterTextureFetchDebugger::idle()
case LLTextureFetchDebugger::REFETCH_VIS_HTTP:
updateButtons();
break;
+ case LLTextureFetchDebugger::REFETCH_ALL_CACHE:
+ updateButtons();
+ case LLTextureFetchDebugger::REFETCH_ALL_HTTP:
+ updateButtons();
+ break;
default:
break;
}
@@ -175,8 +185,27 @@ void LLFloaterTextureFetchDebugger::onClickStart()
mDebugger->startDebug();
mButtonStateMap["start_btn"] = false;
- mButtonStateMap["cacheread_btn"] = true;
- mButtonStateMap["http_btn"] = true;
+
+ if(LLAppViewer::getTextureFetch()->canLoadFromCache())
+ {
+ mButtonStateMap["cacheread_btn"] = true;
+ mButtonStateMap["http_btn"] = false;
+ mButtonStateMap["refetchviscache_btn"] = true;
+ mButtonStateMap["refetchvishttp_btn"] = false;
+ mButtonStateMap["refetchallcache_btn"] = true;
+ mButtonStateMap["refetchallhttp_btn"] = false;
+ mButtonStateMap["cachewrite_btn"] = false;
+ }
+ else
+ {
+ mButtonStateMap["cacheread_btn"] = true;
+ mButtonStateMap["http_btn"] = true;
+ mButtonStateMap["refetchviscache_btn"] = true;
+ mButtonStateMap["refetchvishttp_btn"] = true;
+ mButtonStateMap["refetchallcache_btn"] = true;
+ mButtonStateMap["refetchallhttp_btn"] = true;
+ }
+
updateButtons();
}
@@ -256,6 +285,20 @@ void LLFloaterTextureFetchDebugger::onClickRefetchVisHTTP()
mDebugger->debugRefetchVisibleFromHTTP();
}
+void LLFloaterTextureFetchDebugger::onClickRefetchAllCache()
+{
+ disableButtons();
+
+ mDebugger->debugRefetchAllFromCache();
+}
+
+void LLFloaterTextureFetchDebugger::onClickRefetchAllHTTP()
+{
+ disableButtons();
+
+ mDebugger->debugRefetchAllFromHTTP();
+}
+
void LLFloaterTextureFetchDebugger::draw()
{
//total number of fetched textures
@@ -368,8 +411,22 @@ void LLFloaterTextureFetchDebugger::draw()
else
{
getChild<LLUICtrl>("total_time_refetch_vis_cache_label")->setTextArg("[TIME]", llformat("%.3f", mDebugger->getRefetchVisCacheTime()));
- getChild<LLUICtrl>("total_time_refetch_vis_cache_label")->setTextArg("[SIZE]", llformat("%d", mDebugger->getRefetchedData() >> 10));
- getChild<LLUICtrl>("total_time_refetch_vis_cache_label")->setTextArg("[PIXEL]", llformat("%.3f", mDebugger->getRefetchedPixels() / 1000000.f));
+ getChild<LLUICtrl>("total_time_refetch_vis_cache_label")->setTextArg("[SIZE]", llformat("%d", mDebugger->getRefetchedVisData() >> 10));
+ getChild<LLUICtrl>("total_time_refetch_vis_cache_label")->setTextArg("[PIXEL]", llformat("%.3f", mDebugger->getRefetchedVisPixels() / 1000000.f));
+ }
+
+ //total time on refetching all textures from cache
+ if(mDebugger->getRefetchAllCacheTime() < 0.f)
+ {
+ getChild<LLUICtrl>("total_time_refetch_all_cache_label")->setTextArg("[TIME]", std::string("----"));
+ getChild<LLUICtrl>("total_time_refetch_all_cache_label")->setTextArg("[SIZE]", std::string("----"));
+ getChild<LLUICtrl>("total_time_refetch_all_cache_label")->setTextArg("[PIXEL]", std::string("----"));
+ }
+ else
+ {
+ getChild<LLUICtrl>("total_time_refetch_all_cache_label")->setTextArg("[TIME]", llformat("%.3f", mDebugger->getRefetchAllCacheTime()));
+ getChild<LLUICtrl>("total_time_refetch_all_cache_label")->setTextArg("[SIZE]", llformat("%d", mDebugger->getRefetchedAllData() >> 10));
+ getChild<LLUICtrl>("total_time_refetch_all_cache_label")->setTextArg("[PIXEL]", llformat("%.3f", mDebugger->getRefetchedAllPixels() / 1000000.f));
}
//total time on refetching visible textures from http
@@ -382,8 +439,22 @@ void LLFloaterTextureFetchDebugger::draw()
else
{
getChild<LLUICtrl>("total_time_refetch_vis_http_label")->setTextArg("[TIME]", llformat("%.3f", mDebugger->getRefetchVisHTTPTime()));
- getChild<LLUICtrl>("total_time_refetch_vis_http_label")->setTextArg("[SIZE]", llformat("%d", mDebugger->getRefetchedData() >> 10));
- getChild<LLUICtrl>("total_time_refetch_vis_http_label")->setTextArg("[PIXEL]", llformat("%.3f", mDebugger->getRefetchedPixels() / 1000000.f));
+ getChild<LLUICtrl>("total_time_refetch_vis_http_label")->setTextArg("[SIZE]", llformat("%d", mDebugger->getRefetchedVisData() >> 10));
+ getChild<LLUICtrl>("total_time_refetch_vis_http_label")->setTextArg("[PIXEL]", llformat("%.3f", mDebugger->getRefetchedVisPixels() / 1000000.f));
+ }
+
+ //total time on refetching all textures from http
+ if(mDebugger->getRefetchAllHTTPTime() < 0.f)
+ {
+ getChild<LLUICtrl>("total_time_refetch_all_http_label")->setTextArg("[TIME]", std::string("----"));
+ getChild<LLUICtrl>("total_time_refetch_all_http_label")->setTextArg("[SIZE]", std::string("----"));
+ getChild<LLUICtrl>("total_time_refetch_all_http_label")->setTextArg("[PIXEL]", std::string("----"));
+ }
+ else
+ {
+ getChild<LLUICtrl>("total_time_refetch_all_http_label")->setTextArg("[TIME]", llformat("%.3f", mDebugger->getRefetchAllHTTPTime()));
+ getChild<LLUICtrl>("total_time_refetch_all_http_label")->setTextArg("[SIZE]", llformat("%d", mDebugger->getRefetchedAllData() >> 10));
+ getChild<LLUICtrl>("total_time_refetch_all_http_label")->setTextArg("[PIXEL]", llformat("%.3f", mDebugger->getRefetchedAllPixels() / 1000000.f));
}
LLFloater::draw();