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

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: 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
« src/gpu/SkGr.cpp ('K') | « src/gpu/SkGrPriv.h ('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..fa911827489ad82a4482c9f50c94f9bc275f0ac2 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -320,6 +320,20 @@ sk_sp<SkImage> SkImage::MakeTextureFromPixmap(GrContext* ctx, const SkPixmap& pi
pixmap.alphaType(), texture, budgeted);
}
+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);
+}
+
///////////////////////////////////////////////////////////////////////////////////////////////////
class DeferredTextureImage {
« src/gpu/SkGr.cpp ('K') | « src/gpu/SkGrPriv.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698