aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/SkGr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/SkGr.cpp')
-rw-r--r--src/gpu/SkGr.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index cc05f7ac38..51eb91021d 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -421,13 +421,16 @@ GrTexture* GrUploadMipMapToTexture(GrContext* ctx, const SkImageInfo& info,
GrTexture* GrRefCachedBitmapTexture(GrContext* ctx, const SkBitmap& bitmap,
const GrTextureParams& params,
SkSourceGammaTreatment gammaTreatment) {
- if (bitmap.getTexture()) {
- return GrBitmapTextureAdjuster(&bitmap).refTextureSafeForParams(params, gammaTreatment,
- nullptr);
- }
return GrBitmapTextureMaker(ctx, bitmap).refTextureForParams(params, gammaTreatment);
}
+sk_sp<GrTexture> GrMakeCachedBitmapTexture(GrContext* ctx, const SkBitmap& bitmap,
+ const GrTextureParams& params,
+ SkSourceGammaTreatment gammaTreatment) {
+ GrTexture* tex = GrBitmapTextureMaker(ctx, bitmap).refTextureForParams(params, gammaTreatment);
+ return sk_sp<GrTexture>(tex);
+}
+
///////////////////////////////////////////////////////////////////////////////
// alphatype is ignore for now, but if GrPixelConfig is expanded to encompass