本文整理汇总了C++中LLViewerImage::setDecodePriority方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerImage::setDecodePriority方法的具体用法?C++ LLViewerImage::setDecodePriority怎么用?C++ LLViewerImage::setDecodePriority使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerImage
的用法示例。
在下文中一共展示了LLViewerImage::setDecodePriority方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: decodeAllImages
void LLViewerImageList::decodeAllImages(F32 max_time)
{
LLTimer timer;
if(gNoRender) return;
// Update texture stats and priorities
std::vector<LLPointer<LLViewerImage> > image_list;
for (image_priority_list_t::iterator iter = mImageList.begin();
iter != mImageList.end(); )
{
LLViewerImage* imagep = *iter++;
image_list.push_back(imagep);
imagep->mInImageList = FALSE;
}
mImageList.clear();
for (std::vector<LLPointer<LLViewerImage> >::iterator iter = image_list.begin();
iter != image_list.end(); ++iter)
{
LLViewerImage* imagep = *iter;
imagep->processTextureStats();
F32 decode_priority = imagep->calcDecodePriority();
imagep->setDecodePriority(decode_priority);
mImageList.insert(imagep);
imagep->mInImageList = TRUE;
}
image_list.clear();
// Update fetch (decode)
for (image_priority_list_t::iterator iter = mImageList.begin();
iter != mImageList.end(); )
{
LLViewerImage* imagep = *iter++;
imagep->updateFetch();
}
// Run threads
S32 fetch_pending = 0;
while (1)
{
LLAppViewer::instance()->getTextureCache()->update(1); // unpauses the texture cache thread
LLAppViewer::instance()->getImageDecodeThread()->update(1); // unpauses the image thread
fetch_pending = LLAppViewer::instance()->getTextureFetch()->update(1); // unpauses the texture fetch thread
if (fetch_pending == 0 || timer.getElapsedTimeF32() > max_time)
{
break;
}
}
// Update fetch again
for (image_priority_list_t::iterator iter = mImageList.begin();
iter != mImageList.end(); )
{
LLViewerImage* imagep = *iter++;
imagep->updateFetch();
}
max_time -= timer.getElapsedTimeF32();
max_time = llmax(max_time, .001f);
F32 create_time = updateImagesCreateTextures(max_time);
LL_DEBUGS("ViewerImages") << "decodeAllImages() took " << timer.getElapsedTimeF32() << " seconds. "
<< " fetch_pending " << fetch_pending
<< " create_time " << create_time
<< LL_ENDL;
}