当前位置: 首页>>代码示例>>C++>>正文


C++ LLViewerImage::setDecodePriority方法代码示例

本文整理汇总了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;
}
开发者ID:Avian-IW,项目名称:InWorldz-Viewer,代码行数:62,代码来源:llviewerimagelist.cpp


注:本文中的LLViewerImage::setDecodePriority方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。