GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrTextureParams& params,
                                            const SkImage* client, SkImage::CachingHint chint) {
    if (!ctx) {
        return nullptr;
    }

    return Cacherator_GrTextureMaker(ctx, this, client, chint).refTextureForParams(params);
}
Example #2
0
GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, SkImageUsageType usage,
                                            const SkImage* client) {
    if (!ctx) {
        return nullptr;
    }

    GrUniqueKey key;
    GrMakeKeyFromImageID(&key, this->uniqueID(),
                         SkIRect::MakeWH(this->info().width(), this->info().height()),
                         *ctx->caps(), usage);

    return Cacherator_GrTextureMaker(this, usage, client, key).refCachedTexture(ctx, usage);
}