From 91b43e4fa3d2472058e4db5255aa98ecee74199f Mon Sep 17 00:00:00 2001 From: Mike Reed Date: Wed, 3 May 2017 08:28:03 -0400 Subject: [PATCH] remove unused etc logic Bug: skia: Change-Id: I913d348910db0b6ab930c4c5566ba9eb2320550e Reviewed-on: https://skia-review.googlesource.com/15181 Reviewed-by: Brian Salomon Commit-Queue: Mike Reed --- gn/gn_to_bp.py | 1 - public.bzl | 1 - src/gpu/SkGr.cpp | 30 ------------------------------ src/gpu/SkGr.h | 14 -------------- 4 files changed, 46 deletions(-) diff --git a/gn/gn_to_bp.py b/gn/gn_to_bp.py index c8c7079..92f9aad 100644 --- a/gn/gn_to_bp.py +++ b/gn/gn_to_bp.py @@ -272,7 +272,6 @@ defines.extend([ 'SK_BUILD_FOR_ANDROID_FRAMEWORK', 'SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024)', 'SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024)', - 'SK_IGNORE_ETC1_SUPPORT', 'SK_USE_FREETYPE_EMBOLDEN', ]) # TODO: move these all to android_framework_defines.gni? diff --git a/public.bzl b/public.bzl index 01d70f7..b466cac 100644 --- a/public.bzl +++ b/public.bzl @@ -643,7 +643,6 @@ DEFINES_IOS = [ "SK_BUILD_FOR_IOS", "SK_BUILD_NO_OPTS", "SK_HAS_JPEG_LIBRARY", - "SK_IGNORE_ETC1_SUPPORT", "SKNX_NO_SIMD", ] diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp index 895fdec..d331278 100644 --- a/src/gpu/SkGr.cpp +++ b/src/gpu/SkGr.cpp @@ -37,10 +37,6 @@ #include "effects/GrPorterDuffXferProcessor.h" #include "effects/GrXfermodeFragmentProcessor.h" -#ifndef SK_IGNORE_ETC1_SUPPORT -# include "etc1.h" -#endif - GrSurfaceDesc GrImageInfoToSurfaceDesc(const SkImageInfo& info, const GrCaps& caps) { GrSurfaceDesc desc; desc.fFlags = kNone_GrSurfaceFlags; @@ -64,32 +60,6 @@ void GrMakeKeyFromImageID(GrUniqueKey* key, uint32_t imageID, const SkIRect& ima builder[4] = imageBounds.fBottom; } -GrPixelConfig GrIsCompressedTextureDataSupported(GrContext* ctx, SkData* data, - int expectedW, int expectedH, - const void** outStartOfDataToUpload) { - *outStartOfDataToUpload = nullptr; -#ifndef SK_IGNORE_ETC1_SUPPORT - if (!ctx->caps()->isConfigTexturable(kETC1_GrPixelConfig)) { - return kUnknown_GrPixelConfig; - } - - const uint8_t* bytes = data->bytes(); - if (data->size() > ETC_PKM_HEADER_SIZE && etc1_pkm_is_valid(bytes)) { - // Does the data match the dimensions of the bitmap? If not, - // then we don't know how to scale the image to match it... - if (etc1_pkm_get_width(bytes) != (unsigned)expectedW || - etc1_pkm_get_height(bytes) != (unsigned)expectedH) - { - return kUnknown_GrPixelConfig; - } - - *outStartOfDataToUpload = bytes + ETC_PKM_HEADER_SIZE; - return kETC1_GrPixelConfig; - } -#endif - return kUnknown_GrPixelConfig; -} - ////////////////////////////////////////////////////////////////////////////// sk_sp GrUploadBitmapToTextureProxy(GrResourceProvider* resourceProvider, const SkBitmap& bitmap) { diff --git a/src/gpu/SkGr.h b/src/gpu/SkGr.h index 450f6ff..cefcc48 100644 --- a/src/gpu/SkGr.h +++ b/src/gpu/SkGr.h @@ -271,18 +271,4 @@ void GrInstallBitmapUniqueKeyInvalidator(const GrUniqueKey& key, SkPixelRef* pix to use. */ GrPixelConfig GrRenderableConfigForColorSpace(const SkColorSpace*); -/** - * If the compressed data in the SkData is supported (as a texture format, this returns - * the pixel-config that should be used, and sets outStartOfDataToUpload to the ptr into - * the data where the actual raw data starts (skipping any header bytes). - * - * If the compressed data is not supported, this returns kUnknown_GrPixelConfig, and - * ignores outStartOfDataToUpload. - */ -GrPixelConfig GrIsCompressedTextureDataSupported(GrContext* ctx, SkData* data, - int expectedW, int expectedH, - const void** outStartOfDataToUpload); - - - #endif -- 2.7.4