コード例 #1
0
ファイル: GrResourceCache.cpp プロジェクト: iHaD/skia
bool GrResourceCache::addResource(const GrResourceKey& key, GrGpuResource* resource) {
    if (NULL != resource->cacheAccess().getCacheEntry()) {
        return false;
    }
    
    if (key.isScratch()) {
        SkASSERT(resource->cacheAccess().isScratch());
        SkASSERT(key == resource->cacheAccess().getScratchKey());
    } else {
        if (!resource->cacheAccess().setContentKey(key)) {
            return false;
        }
    }

    // we don't expect to create new resources during a purge. In theory
    // this could cause purgeAsNeeded() into an infinite loop (e.g.
    // each resource destroyed creates and locks 2 resources and
    // unlocks 1 thereby causing a new purge).
    SkASSERT(!fPurging);
    GrAutoResourceCacheValidate atcv(this);

    GrResourceCacheEntry* entry = SkNEW_ARGS(GrResourceCacheEntry, (this, resource));
    resource->cacheAccess().setCacheEntry(entry);

    this->attachToHead(entry);
    this->purgeAsNeeded();
    return true;
}
コード例 #2
0
ファイル: GrTexture.cpp プロジェクト: gw280/skia
bool GrTexture::NeedsFiltering(const GrResourceKey& key) {
    return 0 != (key.getValue32(3) & kFilter_TextureBit);
}
コード例 #3
0
ファイル: GrTexture.cpp プロジェクト: gw280/skia
bool GrTexture::IsScratchTexture(const GrResourceKey& key) {
    return 0 != (key.getValue32(3) & kScratch_TextureBit);
}
コード例 #4
0
ファイル: GrTexture.cpp プロジェクト: gw280/skia
bool GrTexture::NeedsResizing(const GrResourceKey& key) {
    return 0 != (key.getValue32(3) & kNPOT_TextureBit);
}
コード例 #5
0
ファイル: GrGpuResource.cpp プロジェクト: 435420057/soui
void GrGpuResource::setScratchKey(const GrResourceKey& scratchKey) {
    SkASSERT(fScratchKey.isNullScratch());
    SkASSERT(scratchKey.isScratch());
    SkASSERT(!scratchKey.isNullScratch());
    fScratchKey = scratchKey;
}
コード例 #6
0
ファイル: GrTexture.cpp プロジェクト: ConradIrwin/gecko-dev
bool GrTexture::NeedsFiltering(const GrResourceKey& key) {
    return SkToBool(key.getResourceFlags() & kFilter_TextureFlag);
}
コード例 #7
0
ファイル: GrTexture.cpp プロジェクト: ConradIrwin/gecko-dev
bool GrTexture::NeedsResizing(const GrResourceKey& key) {
    return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag);
}
コード例 #8
0
bool GrTexture::NeedsBilerp(const GrResourceKey& key) {
    return SkToBool(key.getResourceFlags() & kBilerp_TextureFlag);
}