本文整理汇总了C++中LLPointer::getBoostLevel方法的典型用法代码示例。如果您正苦于以下问题:C++ LLPointer::getBoostLevel方法的具体用法?C++ LLPointer::getBoostLevel怎么用?C++ LLPointer::getBoostLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLPointer
的用法示例。
在下文中一共展示了LLPointer::getBoostLevel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: equalizeBoostLevels
// This method should be called before each use of the mipmap (typically, before each draw), so that to let
// the boost level of unused tiles to drop to 0 (BOOST_NONE).
// Tiles that are accessed have had their boost level pushed to BOOST_MAP_VISIBLE so we can identify them.
// The result of this strategy is that if a tile is not used during 2 consecutive loops, its boost level drops to 0.
void LLWorldMipmap::equalizeBoostLevels()
{
#if DEBUG_TILES_STAT
S32 nb_missing = 0;
S32 nb_tiles = 0;
S32 nb_visible = 0;
#endif // DEBUG_TILES_STAT
// For each level
for (S32 level = 0; level < MAP_LEVELS; level++)
{
sublevel_tiles_t& level_mipmap = mWorldObjectsMipMap[level];
// For each tile
for (sublevel_tiles_t::iterator iter = level_mipmap.begin(); iter != level_mipmap.end(); iter++)
{
LLPointer<LLViewerFetchedTexture> img = iter->second;
S32 current_boost_level = img->getBoostLevel();
if (current_boost_level == LLGLTexture::BOOST_MAP_VISIBLE)
{
// If level was BOOST_MAP_VISIBLE, the tile has been used in the last draw so keep it high
img->setBoostLevel(LLGLTexture::BOOST_MAP);
}
else
{
// If level was BOOST_MAP only (or anything else...), the tile wasn't used in the last draw
// so we drop its boost level to BOOST_NONE.
img->setBoostLevel(LLGLTexture::BOOST_NONE);
}
#if DEBUG_TILES_STAT
// Increment some stats if compile option on
nb_tiles++;
if (current_boost_level == LLGLTexture::BOOST_MAP_VISIBLE)
{
nb_visible++;
}
if (img->isMissingAsset())
{
nb_missing++;
}
#endif // DEBUG_TILES_STAT
}
}
#if DEBUG_TILES_STAT
LL_INFOS("World Map") << "LLWorldMipmap tile stats : total requested = " << nb_tiles << ", visible = " << nb_visible << ", missing = " << nb_missing << LL_ENDL;
#endif // DEBUG_TILES_STAT
}
示例2: draw
void LLTextureBar::draw()
{
if (!mImagep)
{
return;
}
LLColor4 color;
if (mImagep->getID() == LLAppViewer::getTextureFetch()->mDebugID)
{
color = LLColor4::cyan2;
}
else if (mHilite)
{
S32 idx = llclamp(mHilite,1,3);
if (idx==1) color = LLColor4::orange;
else if (idx==2) color = LLColor4::yellow;
else color = LLColor4::pink2;
}
else if (mImagep->mDontDiscard)
{
color = LLColor4::green4;
}
else if (mImagep->getBoostLevel())
{
color = LLColor4::magenta;
}
else if (mImagep->getDecodePriority() == 0.0f)
{
color = LLColor4::grey; color[VALPHA] = .7f;
}
else
{
color = LLColor4::white; color[VALPHA] = .7f;
}
// We need to draw:
// The texture UUID or name
// The progress bar for the texture, highlighted if it's being download
// Various numerical stats.
std::string tex_str;
S32 left, right;
S32 top = 0;
S32 bottom = top + 6;
LLColor4 clr;
LLGLSUIDefault gls_ui;
// Name, pixel_area, requested pixel area, decode priority
std::string uuid_str;
mImagep->mID.toString(uuid_str);
uuid_str = uuid_str.substr(0,7);
if (mTextureView->mOrderFetch)
{
tex_str = llformat("%s %7.0f %d(%d) 0x%08x(%8.0f)",
uuid_str.c_str(),
mImagep->mMaxVirtualSize,
mImagep->mDesiredDiscardLevel,
mImagep->mRequestedDiscardLevel,
mImagep->mFetchPriority,
mImagep->getDecodePriority());
}
else
{
tex_str = llformat("%s %7.0f %d(%d) %8.0f(0x%08x)",
uuid_str.c_str(),
mImagep->mMaxVirtualSize,
mImagep->mDesiredDiscardLevel,
mImagep->mRequestedDiscardLevel,
mImagep->getDecodePriority(),
mImagep->mFetchPriority);
}
LLFontGL::sMonospace->renderUTF8(tex_str, 0, title_x1, getRect().getHeight(),
color, LLFontGL::LEFT, LLFontGL::TOP);
// State
// Hack: mirrored from lltexturefetch.cpp
struct { const std::string desc; LLColor4 color; } fetch_state_desc[] = {
{ "---", LLColor4::red }, // INVALID
{ "INI", LLColor4::white }, // INIT
{ "DSK", LLColor4::cyan }, // LOAD_FROM_TEXTURE_CACHE
{ "DSK", LLColor4::blue }, // CACHE_POST
{ "NET", LLColor4::green }, // LOAD_FROM_NETWORK
{ "SIM", LLColor4::green }, // LOAD_FROM_SIMULATOR
{ "URL", LLColor4::green2 },// LOAD_FROM_HTTP_GET_URL
{ "HTP", LLColor4::green }, // LOAD_FROM_HTTP_GET_DATA
{ "DEC", LLColor4::yellow },// DECODE_IMAGE
{ "DEC", LLColor4::yellow },// DECODE_IMAGE_UPDATE
{ "WRT", LLColor4::purple },// WRITE_TO_CACHE
{ "WRT", LLColor4::orange },// WAIT_ON_WRITE
{ "END", LLColor4::red }, // DONE
#define LAST_STATE 12
{ "CRE", LLColor4::magenta }, // LAST_STATE+1
{ "FUL", LLColor4::green }, // LAST_STATE+2
{ "BAD", LLColor4::red }, // LAST_STATE+3
{ "MIS", LLColor4::red }, // LAST_STATE+4
{ "---", LLColor4::white }, // LAST_STATE+5
};
const S32 fetch_state_desc_size = (S32)(sizeof(fetch_state_desc)/sizeof(fetch_state_desc[0]));
//.........这里部分代码省略.........
示例3: draw
void LLTextureView::draw()
{
if (!mFreezeView)
{
// LLViewerObject *objectp;
// S32 te;
for_each(mTextureBars.begin(), mTextureBars.end(), KillView());
mTextureBars.clear();
if (mGLTexMemBar)
{
removeChild(mGLTexMemBar);
mGLTexMemBar->die();
mGLTexMemBar = 0;
}
if (mAvatarTexBar)
{
removeChild(mAvatarTexBar);
mAvatarTexBar->die();
mAvatarTexBar = 0;
}
typedef std::multiset<decode_pair_t, compare_decode_pair > display_list_t;
display_list_t display_image_list;
if (mPrintList)
{
llinfos << "ID\tMEM\tBOOST\tPRI\tWIDTH\tHEIGHT\tDISCARD" << llendl;
}
for (LLViewerTextureList::image_priority_list_t::iterator iter = gTextureList.mImageList.begin();
iter != gTextureList.mImageList.end(); )
{
LLPointer<LLViewerFetchedTexture> imagep = *iter++;
if(!imagep->hasFetcher())
{
continue ;
}
S32 cur_discard = imagep->getDiscardLevel();
S32 desired_discard = imagep->mDesiredDiscardLevel;
if (mPrintList)
{
S32 tex_mem = imagep->hasGLTexture() ? imagep->getTextureMemory() : 0 ;
llinfos << imagep->getID()
<< "\t" << tex_mem
<< "\t" << imagep->getBoostLevel()
<< "\t" << imagep->getDecodePriority()
<< "\t" << imagep->getWidth()
<< "\t" << imagep->getHeight()
<< "\t" << cur_discard
<< llendl;
}
if (imagep->getID() == LLAppViewer::getTextureFetch()->mDebugID)
{
static S32 debug_count = 0;
++debug_count; // for breakpoints
}
F32 pri;
if (mOrderFetch)
{
pri = ((F32)imagep->mFetchPriority)/256.f;
}
else
{
pri = imagep->getDecodePriority();
}
pri = llclamp(pri, 0.0f, HIGH_PRIORITY-1.f);
if (sDebugImages.find(imagep) != sDebugImages.end())
{
pri += 4*HIGH_PRIORITY;
}
if (!mOrderFetch)
{
if (pri < HIGH_PRIORITY && LLSelectMgr::getInstance())
{
struct f : public LLSelectedTEFunctor
{
LLViewerFetchedTexture* mImage;
f(LLViewerFetchedTexture* image) : mImage(image) {}
virtual bool apply(LLViewerObject* object, S32 te)
{
return (mImage == object->getTEImage(te));
}
} func(imagep);
const bool firstonly = true;
bool match = LLSelectMgr::getInstance()->getSelection()->applyToTEs(&func, firstonly);
if (match)
{
pri += 3*HIGH_PRIORITY;
}
}
//.........这里部分代码省略.........