Esempio n. 1
0
SkDeviceProfile* SkDeviceProfile::RefGlobal() {
    SkAutoMutexAcquire amc(gMutex);

    if (NULL == gGlobalProfile) {
        gGlobalProfile = SkDeviceProfile::GetDefault();
    }
    gGlobalProfile->ref();
    return gGlobalProfile;
}
Esempio n. 2
0
SkDeviceProfile* SkDeviceProfile::GetDefault() {
    SkAutoMutexAcquire amc(gMutex);

    if (NULL == gDefaultProfile) {
        gDefaultProfile = SkDeviceProfile::Create(DEFAULT_GAMMAEXP,
                                                  DEFAULT_CONTRASTSCALE,
                                                  DEFAULT_LCDCONFIG,
                                                  DEFAULT_FONTHINTLEVEL);
    }
    return gDefaultProfile;
}
Esempio n. 3
0
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;
}
Esempio n. 4
0
void SkDeviceProfile::SetGlobal(SkDeviceProfile* profile) {
    SkAutoMutexAcquire amc(gMutex);

    SkRefCnt_SafeAssign(gGlobalProfile, profile);
}
Esempio n. 5
0
void SkGLCanvas::SetTextureCacheMaxSize(size_t size) {
    SkAutoMutexAcquire amc(gTextureCacheMutex);
    gTextureCache.setMaxSize(size);
}
Esempio n. 6
0
void SkGLCanvas::SetTextureCacheMaxCount(size_t count) {
    SkAutoMutexAcquire amc(gTextureCacheMutex);
    gTextureCache.setMaxCount(count);
}
Esempio n. 7
0
size_t SkGLCanvas::GetTextureCacheMaxSize() {
    SkAutoMutexAcquire amc(gTextureCacheMutex);
    return gTextureCache.getMaxSize();
}
Esempio n. 8
0
void SkGLDevice::UnlockTexCache(TexCache* cache) {
    SkAutoMutexAcquire amc(gTextureCacheMutex);
    gTextureCache.unlock((SkTextureCache::Entry*)cache);
}