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


C++ LLTextureCacheWorker::write方法代码示例

本文整理汇总了C++中LLTextureCacheWorker::write方法的典型用法代码示例。如果您正苦于以下问题:C++ LLTextureCacheWorker::write方法的具体用法?C++ LLTextureCacheWorker::write怎么用?C++ LLTextureCacheWorker::write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LLTextureCacheWorker的用法示例。


在下文中一共展示了LLTextureCacheWorker::write方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: writeToCache

LLTextureCache::handle_t LLTextureCache::writeToCache(const LLUUID& id, U32 priority,
													  U8* data, S32 datasize, S32 imagesize,
													  WriteResponder* responder)
{
	if (mReadOnly)
	{
		delete responder;
		return LLWorkerThread::nullHandle();
	}
	if (mDoPurge)
	{
		// NOTE: This may cause an occasional hiccup,
		//  but it really needs to be done on the control thread
		//  (i.e. here)
		purgeTextures(false);
		mDoPurge = FALSE;
	}

	purgeTextureFilesTimeSliced();	// purge textures from cache in a non-hiccup-way


	if (datasize >= TEXTURE_CACHE_ENTRY_SIZE)
	{
		LLMutexLock lock(&mWorkersMutex);
		llassert_always(imagesize > 0);
		LLTextureCacheWorker* worker = new LLTextureCacheRemoteWorker(this, priority, id,
																data, datasize, 0,
																imagesize, responder);
		handle_t handle = worker->write();
		mWriters[handle] = worker;
		return handle;
	}
	delete responder;
	return LLWorkerThread::nullHandle();
}
开发者ID:Nora28,项目名称:imprudence,代码行数:35,代码来源:lltexturecache.cpp

示例2: writeToCache

LLTextureCache::handle_t LLTextureCache::writeToCache(const LLUUID& id, U32 priority,
													  U8* data, S32 datasize, S32 imagesize,
													  WriteResponder* responder)
{
	if (mReadOnly)
	{
		delete responder;
		return LLWorkerThread::nullHandle();
	}
	if (mDoPurge)
	{
		// NOTE: This may cause an occasional hiccup,
		//  but it really needs to be done on the control thread
		//  (i.e. here)		
		purgeTextures(false);
		mDoPurge = FALSE;
	}
	LLMutexLock lock(&mWorkersMutex);
	LLTextureCacheWorker* worker = new LLTextureCacheRemoteWorker(this, priority, id,
																  data, datasize, 0,
																  imagesize, responder);
	handle_t handle = worker->write();
	mWriters[handle] = worker;
	return handle;
}
开发者ID:9skunks,项目名称:imprudence,代码行数:25,代码来源:lltexturecache.cpp


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