本文整理汇总了C++中LLPointer::getDiscardLevel方法的典型用法代码示例。如果您正苦于以下问题:C++ LLPointer::getDiscardLevel方法的具体用法?C++ LLPointer::getDiscardLevel怎么用?C++ LLPointer::getDiscardLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLPointer
的用法示例。
在下文中一共展示了LLPointer::getDiscardLevel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: output_image_stats
void output_image_stats(LLPointer<LLImageFormatted> image, const std::string &filename)
{
// Print out some statistical data on the image
std::cout << "Image stats for : " << filename << ", extension : " << image->getExtension() << std::endl;
std::cout << " with : " << (int)(image->getWidth()) << ", height : " << (int)(image->getHeight()) << std::endl;
std::cout << " comp : " << (int)(image->getComponents()) << ", levels : " << (int)(image->getDiscardLevel()) << std::endl;
std::cout << " head : " << (int)(image->calcHeaderSize()) << ", data : " << (int)(image->getDataSize()) << std::endl;
return;
}
示例2: draw
//.........这里部分代码省略.........
!mImagep->mIsFetching ? LAST_STATE+5 :
mImagep->mFetchState;
state = llclamp(state,0,fetch_state_desc_size-1);
LLFontGL::sMonospace->renderUTF8(fetch_state_desc[state].desc, 0, title_x2, getRect().getHeight(),
fetch_state_desc[state].color,
LLFontGL::LEFT, LLFontGL::TOP);
LLGLSNoTexture gls_no_texture;
// Draw the progress bar.
S32 bar_width = 100;
S32 bar_left = 280;
left = bar_left;
right = left + bar_width;
gGL.color4f(0.f, 0.f, 0.f, 0.75f);
gl_rect_2d(left, top, right, bottom);
F32 data_progress = mImagep->mDownloadProgress;
if (data_progress > 0.0f)
{
// Downloaded bytes
right = left + llfloor(data_progress * (F32)bar_width);
if (right > left)
{
gGL.color4f(0.f, 0.f, 1.f, 0.75f);
gl_rect_2d(left, top, right, bottom);
}
}
S32 pip_width = 6;
S32 pip_space = 14;
S32 pip_x = title_x3 + pip_space/2;
// Draw the packet pip
F32 last_event = mImagep->mLastPacketTimer.getElapsedTimeF32();
if (last_event < 1.f)
{
clr = LLColor4::white;
}
else
{
last_event = mImagep->mRequestDeltaTime;
if (last_event < 1.f)
{
clr = LLColor4::green;
}
else
{
last_event = mImagep->mFetchDeltaTime;
if (last_event < 1.f)
{
clr = LLColor4::yellow;
}
}
}
if (last_event < 1.f)
{
clr.setAlpha(1.f - last_event);
gGL.color4fv(clr.mV);
gl_rect_2d(pip_x, top, pip_x + pip_width, bottom);
}
pip_x += pip_width + pip_space;
// we don't want to show bind/resident pips for textures using the default texture
if (mImagep->getHasGLTexture())
{
// Draw the bound pip
last_event = mImagep->sLastFrameTime - mImagep->mLastBindTime;
if (last_event < 1.f)
{
clr = mImagep->getMissed() ? LLColor4::red : LLColor4::magenta1;
clr.setAlpha(1.f - last_event);
gGL.color4fv(clr.mV);
gl_rect_2d(pip_x, top, pip_x + pip_width, bottom);
}
}
pip_x += pip_width + pip_space;
{
LLGLSUIDefault gls_ui;
// draw the packet data
// {
// std::string num_str = llformat("%3d/%3d", mImagep->mLastPacket+1, mImagep->mPackets);
// LLFontGL::sMonospace->renderUTF8(num_str, 0, bar_left + 100, getRect().getHeight(), color,
// LLFontGL::LEFT, LLFontGL::TOP);
// }
// draw the image size at the end
{
std::string num_str = llformat("%3dx%3d (%d) %7d", mImagep->getWidth(), mImagep->getHeight(),
mImagep->getDiscardLevel(), mImagep->mTextureMemory);
LLFontGL::sMonospace->renderUTF8(num_str, 0, title_x4, getRect().getHeight(), color,
LLFontGL::LEFT, LLFontGL::TOP);
}
}
}
示例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;
}
}
//.........这里部分代码省略.........