remove unused etc logic
authorMike Reed <reed@google.com>
Wed, 3 May 2017 12:28:03 +0000 (08:28 -0400)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Wed, 3 May 2017 12:55:43 +0000 (12:55 +0000)
Bug: skia:
Change-Id: I913d348910db0b6ab930c4c5566ba9eb2320550e
Reviewed-on: https://skia-review.googlesource.com/15181
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>

gn/gn_to_bp.py
public.bzl
src/gpu/SkGr.cpp
src/gpu/SkGr.h

index c8c7079..92f9aad 100644 (file)
@@ -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?
index 01d70f7..b466cac 100644 (file)
@@ -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",
 ]
 
index 895fdec..d331278 100644 (file)
 #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<GrTextureProxy> GrUploadBitmapToTextureProxy(GrResourceProvider* resourceProvider,
                                                    const SkBitmap& bitmap) {
index 450f6ff..cefcc48 100644 (file)
@@ -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