Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(692)

Unified Diff: src/image/SkImage_Gpu.cpp

Issue 2031273002: Plumbing mipmaps to the point of creation. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: MakeTextureFromMipMap is now private. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/image/SkImage.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+}
« no previous file with comments | « src/image/SkImage.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698