本文整理汇总了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();
}
示例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;
}