diff options
author | Hal Canary <halcanary@google.com> | 2016-11-22 11:57:18 -0700 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-11-22 19:47:21 +0000 |
commit | e8eed323ef7ea1c3c7057d49f3306b8ff41676e8 (patch) | |
tree | 9c2e0bbb08c91857cc9908715d2b99a4cafff9e2 /src/gpu | |
parent | fec1dea8098fe09f04fff542efdb83edc1fe8240 (diff) |
remove SkPixelRef::refEncodedData()
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5001
Change-Id: I15dba4f44c762ab69a23eb8a77adff5f63763e30
Reviewed-on: https://skia-review.googlesource.com/5001
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/SkGr.cpp | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp index 471a39305f..1319102150 100644 --- a/src/gpu/SkGr.cpp +++ b/src/gpu/SkGr.cpp @@ -198,27 +198,8 @@ static sk_sp<GrTexture> create_texture_from_yuv(GrContext* ctx, const SkBitmap& return provider.refAsTexture(ctx, desc, !bm.isVolatile()); } -static GrTexture* load_etc1_texture(GrContext* ctx, const SkBitmap &bm, GrSurfaceDesc desc) { - sk_sp<SkData> data(bm.pixelRef()->refEncodedData()); - if (!data) { - return nullptr; - } - - const void* startOfTexData; - desc.fConfig = GrIsCompressedTextureDataSupported(ctx, data.get(), bm.width(), bm.height(), - &startOfTexData); - if (kUnknown_GrPixelConfig == desc.fConfig) { - return nullptr; - } - - return ctx->textureProvider()->createTexture(desc, SkBudgeted::kYes, startOfTexData, 0); -} - GrTexture* GrUploadBitmapToTexture(GrContext* ctx, const SkBitmap& bitmap) { GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(bitmap.info(), *ctx->caps()); - if (GrTexture *texture = load_etc1_texture(ctx, bitmap, desc)) { - return texture; - } sk_sp<GrTexture> texture(create_texture_from_yuv(ctx, bitmap, desc)); if (texture) { @@ -342,13 +323,6 @@ GrTexture* GrGenerateMipMapsAndUploadToTexture(GrContext* ctx, const SkBitmap& b SkDestinationSurfaceColorMode colorMode) { GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(bitmap.info(), *ctx->caps()); - if (kIndex_8_SkColorType != bitmap.colorType() && !bitmap.readyToDraw()) { - GrTexture* texture = load_etc1_texture(ctx, bitmap, desc); - if (texture) { - return texture; - } - } - sk_sp<GrTexture> texture(create_texture_from_yuv(ctx, bitmap, desc)); if (texture) { return texture.release(); |