GrTexture* GrRefCachedBitmapTexture(GrContext* ctx, const SkBitmap& bitmap, const GrTextureParams& params) { if (bitmap.getTexture()) { return GrBitmapTextureAdjuster(&bitmap).refTextureSafeForParams(params, nullptr); } return GrBitmapTextureMaker(ctx, bitmap).refTextureForParams(params); }
sk_sp<GrTextureProxy> GrRefCachedBitmapTextureProxy(GrContext* ctx, const SkBitmap& bitmap, const GrSamplerState& params, SkScalar scaleAdjust[2]) { // Caller doesn't care about the texture's color space (they can always get it from the bitmap) return GrBitmapTextureMaker(ctx, bitmap).refTextureProxyForParams(params, nullptr, nullptr, scaleAdjust); }