Index: src/image/SkImage_Gpu.cpp |
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp |
index f67d7aa34b4dc0f9618be3db8157769b0342b5c1..a728c3dae594f41385891352110363be3ded29c2 100644 |
--- a/src/image/SkImage_Gpu.cpp |
+++ b/src/image/SkImage_Gpu.cpp |
@@ -468,3 +468,16 @@ GrTexture* GrDeepCopyTexture(GrTexture* src, SkBudgeted budgeted) { |
return dst; |
} |
+sk_sp<SkImage> SkImage::MakeTextureFromMipMap(GrContext* ctx, const SkImageInfo& info, |
+ const GrMipLevel* texels, int mipLevelCount, |
+ SkBudgeted budgeted) { |
+ if (!ctx) { |
+ return nullptr; |
+ } |
+ SkAutoTUnref<GrTexture> texture(GrUploadMipMapToTexture(ctx, info, texels, mipLevelCount)); |
+ if (!texture) { |
+ return nullptr; |
+ } |
+ return sk_make_sp<SkImage_Gpu>(texture->width(), texture->height(), kNeedNewImageUniqueID, |
+ info.alphaType(), texture, budgeted); |
+} |