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


C++ LLTextureCacheWorker类代码示例

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


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

示例1: completed

		void completed(S32 bytes)
		{
			mCache->lockWorkers();
			LLTextureCacheWorker* writer = mCache->getWriter(mHandle);
			if (writer) writer->ioComplete(bytes);
			mCache->unlockWorkers();
		}
开发者ID:Nora28,项目名称:imprudence,代码行数:7,代码来源:lltexturecache.cpp

示例2: purgeTextures

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

示例3: purgeTextures

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

示例4: lockWorkers

// Return true if the handle is not valid, which is the case
// when the worker was already deleted or is scheduled for deletion.
//
// If the handle exists and a call to worker->complete() returns
// true or abort is true, then the handle is removed and the worker
// scheduled for deletion.
bool LLTextureCache::readComplete(handle_t handle, bool abort)
{
	lockWorkers();	// Needed for access to mReaders.

	handle_map_t::iterator iter = mReaders.find(handle);
	bool handle_is_valid = iter != mReaders.end();
	llassert_always(handle_is_valid || abort);
	LLTextureCacheWorker* worker = NULL;
	bool delete_worker = false;

	if (handle_is_valid)
	{
		worker = iter->second;
		delete_worker = worker->complete() || abort;
		if (delete_worker)
		{
			mReaders.erase(handle);
			handle_is_valid = false;
		}
	}

	unlockWorkers();

	if (delete_worker) worker->scheduleDelete();

	// Return false if the handle is (still) valid.
	return !handle_is_valid;
}
开发者ID:9skunks,项目名称:imprudence,代码行数:34,代码来源:lltexturecache.cpp

示例5: lock

LLTextureCache::handle_t LLTextureCache::readFromCache(const LLUUID& id, U32 priority,
													   S32 offset, S32 size, ReadResponder* responder)
{
	// Note: checking to see if an entry exists can cause a stall,
	//  so let the thread handle it
	LLMutexLock lock(&mWorkersMutex);
	LLTextureCacheWorker* worker = new LLTextureCacheRemoteWorker(this, priority, id,
															NULL, size, offset, 0,
															responder);
	handle_t handle = worker->read();
	mReaders[handle] = worker;
	return handle;
}
开发者ID:Nora28,项目名称:imprudence,代码行数:13,代码来源:lltexturecache.cpp

示例6: lockWorkers

bool LLTextureCache::writeComplete(handle_t handle, bool abort)
{
	lockWorkers();
	handle_map_t::iterator iter = mWriters.find(handle);
	llassert_always(iter != mWriters.end());
	LLTextureCacheWorker* worker = iter->second;
	if (worker->complete() || abort)
	{
		mWriters.erase(handle);
		unlockWorkers();
		worker->scheduleDelete();
		return true;
	}
	else
	{
		unlockWorkers();
		return false;
	}
}
开发者ID:Nora28,项目名称:imprudence,代码行数:19,代码来源:lltexturecache.cpp


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