diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llpreviewtexture.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llsidepanelinventory.cpp | 25 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llviewertexture.cpp | 86 | ||||
-rw-r--r-- | indra/newview/llviewertexture.h | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_viewer.xml | 18 |
6 files changed, 71 insertions, 69 deletions
diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index d2527065db..3eab13fc4a 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -204,11 +204,6 @@ void LLPreviewTexture::draw() // Pump the texture priority F32 pixel_area = mLoadingFullImage ? (F32)MAX_IMAGE_AREA : (F32)(interior.getWidth() * interior.getHeight() ); mImage->addTextureStats( pixel_area ); - if(pixel_area > 0.f) - { - //boost the previewed image priority to the highest to make it to get loaded first. - mImage->setAdditionalDecodePriority(1.0f) ; - } // Don't bother decoding more than we can display, unless // we're loading the full image. diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 3a1b354c50..6aa5c53194 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -95,8 +95,11 @@ BOOL LLSidepanelInventory::postBuild() // UI elements from task panel
{
mTaskPanel = getChild<LLSidepanelTaskInfo>("sidepanel__task_panel");
- LLButton* back_btn = mTaskPanel->getChild<LLButton>("back_btn");
- back_btn->setClickedCallback(boost::bind(&LLSidepanelInventory::onBackButtonClicked, this));
+ if (mTaskPanel)
+ {
+ LLButton* back_btn = mTaskPanel->getChild<LLButton>("back_btn");
+ back_btn->setClickedCallback(boost::bind(&LLSidepanelInventory::onBackButtonClicked, this));
+ }
}
return TRUE;
@@ -120,7 +123,8 @@ void LLSidepanelInventory::onOpen(const LLSD& key) }
if (key.has("task"))
{
- mTaskPanel->setObjectSelection(LLSelectMgr::getInstance()->getSelection());
+ if (mTaskPanel)
+ mTaskPanel->setObjectSelection(LLSelectMgr::getInstance()->getSelection());
showTaskInfoPanel();
}
}
@@ -184,7 +188,8 @@ void LLSidepanelInventory::onSelectionChange(const std::deque<LLFolderViewItem*> void LLSidepanelInventory::showItemInfoPanel()
{
mItemPanel->setVisible(TRUE);
- mTaskPanel->setVisible(FALSE);
+ if (mTaskPanel)
+ mTaskPanel->setVisible(FALSE);
mInventoryPanel->setVisible(FALSE);
mItemPanel->dirty();
@@ -194,17 +199,21 @@ void LLSidepanelInventory::showItemInfoPanel() void LLSidepanelInventory::showTaskInfoPanel()
{
mItemPanel->setVisible(FALSE);
- mTaskPanel->setVisible(TRUE);
mInventoryPanel->setVisible(FALSE);
- mTaskPanel->dirty();
- mTaskPanel->setIsEditing(FALSE);
+ if (mTaskPanel)
+ {
+ mTaskPanel->setVisible(TRUE);
+ mTaskPanel->dirty();
+ mTaskPanel->setIsEditing(FALSE);
+ }
}
void LLSidepanelInventory::showInventoryPanel()
{
mItemPanel->setVisible(FALSE);
- mTaskPanel->setVisible(FALSE);
+ if (mTaskPanel)
+ mTaskPanel->setVisible(FALSE);
mInventoryPanel->setVisible(TRUE);
updateVerbs();
}
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 207f0e3f42..a3b119456b 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5192,7 +5192,7 @@ void show_debug_menus() gMenuBarView->setItemEnabled("Develop", qamode); // Server ('Admin') menu hidden when not in godmode. - const bool show_server_menu = debug && (gAgent.getGodLevel() > GOD_NOT); + const bool show_server_menu = debug && (gAgent.getGodLevel() > GOD_NOT || gAgent.getAdminOverride()); gMenuBarView->setItemVisible("Admin", show_server_menu); gMenuBarView->setItemEnabled("Admin", show_server_menu); } diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index b2d7d71b53..9923c9ac74 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -986,8 +986,6 @@ void LLViewerFetchedTexture::init(bool firstinit) mFetchPriority = 0; mDownloadProgress = 0.f; mFetchDeltaTime = 999999.f; - mDecodeFrame = 0; - mVisibleFrame = 0; mForSculpt = FALSE ; mIsFetched = FALSE ; @@ -1370,16 +1368,6 @@ void LLViewerFetchedTexture::processTextureStats() } } -//texture does not have any data, so we don't know the size of the image, treat it like 32 * 32. -F32 LLViewerFetchedTexture::calcDecodePriorityForUnknownTexture(F32 pixel_priority) -{ - F32 desired = (F32)(log(32.0/pixel_priority) / log_2); - S32 ddiscard = MAX_DISCARD_LEVEL - (S32)desired + 1; - ddiscard = llclamp(ddiscard, 1, 9); - - return ddiscard*100000.f; -} - F32 LLViewerFetchedTexture::calcDecodePriority() { #ifndef LL_RELEASE_FOR_DOWNLOAD @@ -1406,12 +1394,6 @@ F32 LLViewerFetchedTexture::calcDecodePriority() S32 cur_discard = getDiscardLevel(); bool have_all_data = (cur_discard >= 0 && (cur_discard <= mDesiredDiscardLevel)); F32 pixel_priority = fsqrtf(mMaxVirtualSize); - const S32 MIN_NOT_VISIBLE_FRAMES = 30; // NOTE: this function is not called every frame - mDecodeFrame++; - if (pixel_priority > 0.f) - { - mVisibleFrame = mDecodeFrame; - } F32 priority; if (mIsMissingAsset) @@ -1422,10 +1404,6 @@ F32 LLViewerFetchedTexture::calcDecodePriority() { priority = -1.0f ; } - else if (!isJustBound() && mCachedRawImageReady && !mBoostLevel) - { - priority = -1.0f; - } else if(mCachedRawDiscardLevel > -1 && mDesiredDiscardLevel >= mCachedRawDiscardLevel) { priority = -1.0f; @@ -1447,11 +1425,6 @@ F32 LLViewerFetchedTexture::calcDecodePriority() // Always want high boosted images priority = 1.f; } - else if (mVisibleFrame == 0 || (mDecodeFrame - mVisibleFrame > MIN_NOT_VISIBLE_FRAMES)) - { - // Don't decode anything that isn't visible unless it's important - priority = -2.0f; - } else { // Leave the priority as-is @@ -1460,7 +1433,13 @@ F32 LLViewerFetchedTexture::calcDecodePriority() } else if (cur_discard < 0) { - priority = calcDecodePriorityForUnknownTexture(pixel_priority) ; + //texture does not have any data, so we don't know the size of the image, treat it like 32 * 32. + // priority range = 100,000 - 500,000 + static const F64 log_2 = log(2.0); + F32 desired = (F32)(log(32.0/pixel_priority) / log_2); + S32 ddiscard = MAX_DISCARD_LEVEL - (S32)desired; + ddiscard = llclamp(ddiscard, 0, 4); + priority = (ddiscard+1)*100000.f; } else if ((mMinDiscardLevel > 0) && (cur_discard <= mMinDiscardLevel)) { @@ -1473,38 +1452,47 @@ F32 LLViewerFetchedTexture::calcDecodePriority() } else { - // priority range = 100000-400000 - S32 ddiscard = cur_discard - mDesiredDiscardLevel; + // priority range = 100,000 - 500,000 + S32 desired_discard = mDesiredDiscardLevel; if (getDontDiscard()) { - ddiscard+=2; + desired_discard -= 2; } - else if (ddiscard > 2 && mGLTexturep.notNull() && !mGLTexturep->getBoundRecently() && mBoostLevel == LLViewerTexture::BOOST_NONE) + else if (!isJustBound() && mCachedRawImageReady && !mBoostLevel) { - ddiscard-=2; + // We haven't rendered this in the last half second, and we have a cached raw image, leave the desired discard as-is + desired_discard = cur_discard; } + else if (mGLTexturep.notNull() && !mGLTexturep->getBoundRecently() && mBoostLevel == LLViewerTexture::BOOST_NONE) + { + // We haven't rendered this in a while, de-prioritize it + desired_discard += 2; + } + S32 ddiscard = cur_discard - desired_discard; ddiscard = llclamp(ddiscard, 0, 4); - priority = ddiscard*100000.f; + priority = (ddiscard+1)*100000.f; } + + // Priority Formula: + // BOOST_HIGH + ADDITIONAL PRI + DELTA DISCARD + BOOST LEVEL + PIXELS + // [10,000,000] + [1-9,000,000] + [1-400,000] + [1-20,000] + [0-999] if (priority > 0.0f) { - // priority range = 100000-900000 - pixel_priority = llclamp(pixel_priority, 0.0f, priority-1.f); + pixel_priority = llclamp(pixel_priority, 0.0f, 999.f); + + priority = pixel_priority + 1000.f * mBoostLevel; - // priority range = [100000.f, 2000000.f] if ( mBoostLevel > BOOST_HIGH) { - priority = 1000000.f + pixel_priority + 1000.f * (mBoostLevel - LLViewerTexture::BOOST_NONE); + priority += 10000000.f; } - else - { - priority += 0.f + pixel_priority + 1000.f * (mBoostLevel - LLViewerTexture::BOOST_NONE); - } - - // priority range = [2100000.f, 5000000.f] if mAdditionalDecodePriority > 1.0 - if(mAdditionalDecodePriority > 1.0f) + + if(mAdditionalDecodePriority > 0.0f) { - priority += 2000000.f + mAdditionalDecodePriority ; + // 1-9 + S32 additional_priority = (S32)(1.0f + mAdditionalDecodePriority*8.0f + .5f); // round + // priority range += 0-9,000,000 + priority += 1000000.f * (F32)additional_priority; } } return priority; @@ -1517,13 +1505,9 @@ void LLViewerFetchedTexture::setDecodePriority(F32 priority) mDecodePriority = priority; } -F32 LLViewerFetchedTexture::maxAdditionalDecodePriority() -{ - return 2000000.f; -} void LLViewerFetchedTexture::setAdditionalDecodePriority(F32 priority) { - priority *= maxAdditionalDecodePriority(); + priority = llclamp(priority, 0.f, 1.f); if(mAdditionalDecodePriority < priority) { mAdditionalDecodePriority = priority; diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 4da6620658..bde87d1dd5 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -383,7 +383,6 @@ public: F32 getDecodePriority() const { return mDecodePriority; }; void setAdditionalDecodePriority(F32 priority) ; - F32 maxAdditionalDecodePriority() ; void updateVirtualSize() ; @@ -454,7 +453,6 @@ private: void init(bool firstinit) ; void cleanup() ; - F32 calcDecodePriorityForUnknownTexture(F32 pixel_priority) ; void saveRawImage() ; BOOL forceFetch() ; void setCachedRawImage() ; @@ -488,8 +486,6 @@ protected: F32 mDownloadProgress; F32 mFetchDeltaTime; F32 mRequestDeltaTime; - S32 mDecodeFrame; - S32 mVisibleFrame; // decode frame where image was last visible F32 mDecodePriority; // The priority for decoding this image. S32 mMinDiscardLevel; S8 mDesiredDiscardLevel; // The discard level we'd LIKE to have - if we have it and there's space diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 633c258ecc..66c9060b06 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -98,6 +98,24 @@ function="World.SetBusy"/> </menu_item_call> </menu> + <menu_item_call + label="Request Admin Status" + layout="topleft" + name="Request Admin Options" + shortcut="control|alt|G" + visible="false"> + <menu_item_call.on_click + function="Advanced.RequestAdminStatus" /> + </menu_item_call> + <menu_item_call + label="Leave Admin Status" + layout="topleft" + name="Leave Admin Options" + shortcut="control|alt|shift|G" + visible="false"> + <menu_item_call.on_click + function="Advanced.LeaveAdminStatus" /> + </menu_item_call> <menu_item_separator layout="topleft" /> <menu_item_call |