SkDeviceProfile* SkDeviceProfile::RefGlobal() { SkAutoMutexAcquire amc(gMutex); if (NULL == gGlobalProfile) { gGlobalProfile = SkDeviceProfile::GetDefault(); } gGlobalProfile->ref(); return gGlobalProfile; }
SkDeviceProfile* SkDeviceProfile::GetDefault() { SkAutoMutexAcquire amc(gMutex); if (NULL == gDefaultProfile) { gDefaultProfile = SkDeviceProfile::Create(DEFAULT_GAMMAEXP, DEFAULT_CONTRASTSCALE, DEFAULT_LCDCONFIG, DEFAULT_FONTHINTLEVEL); } return gDefaultProfile; }
SkGLDevice::TexCache* SkGLDevice::LockTexCache(const SkBitmap& bitmap, GLuint* name, SkPoint* size) { SkAutoMutexAcquire amc(gTextureCacheMutex); void* ctx = SkGetGLContext(); if (gTextureGLContext != ctx) { gTextureGLContext = ctx; gTextureCache.zapAllTextures(); } SkTextureCache::Entry* entry = gTextureCache.lock(bitmap); if (NULL != entry) { if (name) { *name = entry->name(); } if (size) { *size = entry->texSize(); } } return (TexCache*)entry; }
void SkDeviceProfile::SetGlobal(SkDeviceProfile* profile) { SkAutoMutexAcquire amc(gMutex); SkRefCnt_SafeAssign(gGlobalProfile, profile); }
void SkGLCanvas::SetTextureCacheMaxSize(size_t size) { SkAutoMutexAcquire amc(gTextureCacheMutex); gTextureCache.setMaxSize(size); }
void SkGLCanvas::SetTextureCacheMaxCount(size_t count) { SkAutoMutexAcquire amc(gTextureCacheMutex); gTextureCache.setMaxCount(count); }
size_t SkGLCanvas::GetTextureCacheMaxSize() { SkAutoMutexAcquire amc(gTextureCacheMutex); return gTextureCache.getMaxSize(); }
void SkGLDevice::UnlockTexCache(TexCache* cache) { SkAutoMutexAcquire amc(gTextureCacheMutex); gTextureCache.unlock((SkTextureCache::Entry*)cache); }