Propogate SkBudgeted for NewFromDeferredTextureImageData
The budgeted flag was not propogated from
NewFromDeferredTextureImageData to MakeTextureFromPixmap, resulting in
the created textures always being budgeted, even when SkBudgeted::kNo
was passed in.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1809663002
Review URL: https://codereview.chromium.org/1809663002
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index 1463336..9ab8843 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -230,10 +230,10 @@
if (!bitmap.peekPixels(&pixmap)) {
return nullptr;
}
- return GrUploadPixmapToTexture(ctx, pixmap);
+ return GrUploadPixmapToTexture(ctx, pixmap, SkBudgeted::kYes);
}
-GrTexture* GrUploadPixmapToTexture(GrContext* ctx, const SkPixmap& pixmap) {
+GrTexture* GrUploadPixmapToTexture(GrContext* ctx, const SkPixmap& pixmap, SkBudgeted budgeted) {
const SkPixmap* pmap = &pixmap;
SkPixmap tmpPixmap;
SkBitmap tmpBitmap;
@@ -250,7 +250,7 @@
// our compressed data will be trimmed, so pass width() for its
// "rowBytes", since they are the same now.
- return ctx->textureProvider()->createTexture(desc, SkBudgeted::kYes, storage.get(),
+ return ctx->textureProvider()->createTexture(desc, budgeted, storage.get(),
pixmap.width());
} else {
SkImageInfo info = SkImageInfo::MakeN32Premul(pixmap.width(), pixmap.height());
@@ -267,7 +267,7 @@
}
}
- return ctx->textureProvider()->createTexture(desc, SkBudgeted::kYes, pmap->addr(),
+ return ctx->textureProvider()->createTexture(desc, budgeted, pmap->addr(),
pmap->rowBytes());
}