compressed texture support has been broken/untested for a while, remove cruft
authorreed <reed@google.com>
Wed, 11 May 2016 15:06:11 +0000 (08:06 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 11 May 2016 15:06:11 +0000 (08:06 -0700)
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1970773002

Review-Url: https://codereview.chromium.org/1970773002

20 files changed:
gm/astcbitmap.cpp [deleted file]
resources/mandrill_128.ktx [deleted file]
resources/mandrill_128.pkm [deleted file]
resources/mandrill_128.r11.ktx [deleted file]
resources/mandrill_128x128_4x4.astc [deleted file]
resources/mandrill_128x128_8x8.astc [deleted file]
resources/mandrill_128x130_8x5.astc [deleted file]
resources/mandrill_128x132_8x6.astc [deleted file]
resources/mandrill_130x128_10x8.astc [deleted file]
resources/mandrill_130x128_5x4.astc [deleted file]
resources/mandrill_130x130_10x10.astc [deleted file]
resources/mandrill_130x130_10x5.astc [deleted file]
resources/mandrill_130x130_5x5.astc [deleted file]
resources/mandrill_130x132_10x6.astc [deleted file]
resources/mandrill_132x130_12x10.astc [deleted file]
resources/mandrill_132x130_6x5.astc [deleted file]
resources/mandrill_132x132_12x12.astc [deleted file]
resources/mandrill_132x132_6x6.astc [deleted file]
resources/mandrill_512.pkm [deleted file]
src/core/SkImageCacherator.cpp

diff --git a/gm/astcbitmap.cpp b/gm/astcbitmap.cpp
deleted file mode 100644 (file)
index ca8a4f4..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2014 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "gm.h"
-
-#include "Resources.h"
-#include "SkCanvas.h"
-#include "SkData.h"
-#include "SkImage.h"
-#include "SkImageGenerator.h"
-#include "SkOSFile.h"
-#include "SkTextureCompressor.h"
-
-static const char *kASTCFilenames[] = {
-    "mandrill_128x128_4x4.astc",    // kASTC_4x4_Format
-    "mandrill_130x128_5x4.astc",    // kASTC_5x4_Format
-    "mandrill_130x130_5x5.astc",    // kASTC_5x5_Format
-    "mandrill_132x130_6x5.astc",    // kASTC_6x5_Format
-    "mandrill_132x132_6x6.astc",    // kASTC_6x6_Format
-    "mandrill_128x130_8x5.astc",    // kASTC_8x5_Format
-    "mandrill_128x132_8x6.astc",    // kASTC_8x6_Format
-    "mandrill_128x128_8x8.astc",    // kASTC_8x8_Format
-    "mandrill_130x130_10x5.astc",   // kASTC_10x5_Format
-    "mandrill_130x132_10x6.astc",   // kASTC_10x6_Format
-    "mandrill_130x128_10x8.astc",   // kASTC_10x8_Format
-    "mandrill_130x130_10x10.astc",  // kASTC_10x10_Format
-    "mandrill_132x130_12x10.astc",  // kASTC_12x10_Format
-    "mandrill_132x132_12x12.astc",  // kASTC_12x12_Format
-};
-
-static const int kNumASTCFilenames = SK_ARRAY_COUNT(kASTCFilenames);
-
-static inline const char *get_astc_filename(int idx) {
-    if (idx < 0 || kNumASTCFilenames <= idx) {
-        return "";
-    }
-    return kASTCFilenames[idx];
-}
-
-namespace {
-const int kGMDimension = 600;
-const int kBitmapDimension = kGMDimension / 4;
-}  // namespace
-
-DEF_SIMPLE_GM(astcbitmap, canvas, kGMDimension, kGMDimension) {
-    for (int j = 0; j < 4; ++j) {
-        for (int i = 0; i < 4; ++i) {
-            SkBitmap bm;
-            if (GetResourceAsBitmap(get_astc_filename(j*4+i), &bm)) {
-                const SkScalar bmX = static_cast<SkScalar>(i*kBitmapDimension);
-                const SkScalar bmY = static_cast<SkScalar>(j*kBitmapDimension);
-                canvas->drawBitmap(bm, bmX, bmY);
-            }
-        }
-    }
-}
-
-DEF_SIMPLE_GM(astc_image, canvas, kGMDimension, kGMDimension) {
-    for (int j = 0; j < 4; ++j) {
-        for (int i = 0; i < 4; ++i) {
-            sk_sp<SkImage> image(GetResourceAsImage(get_astc_filename(j*4+i)));
-            if (image) {
-                const SkScalar bmX = static_cast<SkScalar>(i*kBitmapDimension);
-                const SkScalar bmY = static_cast<SkScalar>(j*kBitmapDimension);
-                canvas->drawImage(image, bmX, bmY);
-            }
-        }
-    }
-}
diff --git a/resources/mandrill_128.ktx b/resources/mandrill_128.ktx
deleted file mode 100644 (file)
index cf7a757..0000000
Binary files a/resources/mandrill_128.ktx and /dev/null differ
diff --git a/resources/mandrill_128.pkm b/resources/mandrill_128.pkm
deleted file mode 100644 (file)
index feec177..0000000
Binary files a/resources/mandrill_128.pkm and /dev/null differ
diff --git a/resources/mandrill_128.r11.ktx b/resources/mandrill_128.r11.ktx
deleted file mode 100644 (file)
index 932ac4c..0000000
Binary files a/resources/mandrill_128.r11.ktx and /dev/null differ
diff --git a/resources/mandrill_128x128_4x4.astc b/resources/mandrill_128x128_4x4.astc
deleted file mode 100644 (file)
index 0b22300..0000000
Binary files a/resources/mandrill_128x128_4x4.astc and /dev/null differ
diff --git a/resources/mandrill_128x128_8x8.astc b/resources/mandrill_128x128_8x8.astc
deleted file mode 100644 (file)
index 4c4019e..0000000
Binary files a/resources/mandrill_128x128_8x8.astc and /dev/null differ
diff --git a/resources/mandrill_128x130_8x5.astc b/resources/mandrill_128x130_8x5.astc
deleted file mode 100644 (file)
index d835665..0000000
Binary files a/resources/mandrill_128x130_8x5.astc and /dev/null differ
diff --git a/resources/mandrill_128x132_8x6.astc b/resources/mandrill_128x132_8x6.astc
deleted file mode 100644 (file)
index 618cb65..0000000
Binary files a/resources/mandrill_128x132_8x6.astc and /dev/null differ
diff --git a/resources/mandrill_130x128_10x8.astc b/resources/mandrill_130x128_10x8.astc
deleted file mode 100644 (file)
index 98597f2..0000000
Binary files a/resources/mandrill_130x128_10x8.astc and /dev/null differ
diff --git a/resources/mandrill_130x128_5x4.astc b/resources/mandrill_130x128_5x4.astc
deleted file mode 100644 (file)
index cd150a9..0000000
Binary files a/resources/mandrill_130x128_5x4.astc and /dev/null differ
diff --git a/resources/mandrill_130x130_10x10.astc b/resources/mandrill_130x130_10x10.astc
deleted file mode 100644 (file)
index dcda936..0000000
Binary files a/resources/mandrill_130x130_10x10.astc and /dev/null differ
diff --git a/resources/mandrill_130x130_10x5.astc b/resources/mandrill_130x130_10x5.astc
deleted file mode 100644 (file)
index f067ee6..0000000
Binary files a/resources/mandrill_130x130_10x5.astc and /dev/null differ
diff --git a/resources/mandrill_130x130_5x5.astc b/resources/mandrill_130x130_5x5.astc
deleted file mode 100644 (file)
index df82775..0000000
Binary files a/resources/mandrill_130x130_5x5.astc and /dev/null differ
diff --git a/resources/mandrill_130x132_10x6.astc b/resources/mandrill_130x132_10x6.astc
deleted file mode 100644 (file)
index b8c4ec9..0000000
Binary files a/resources/mandrill_130x132_10x6.astc and /dev/null differ
diff --git a/resources/mandrill_132x130_12x10.astc b/resources/mandrill_132x130_12x10.astc
deleted file mode 100644 (file)
index db4c989..0000000
Binary files a/resources/mandrill_132x130_12x10.astc and /dev/null differ
diff --git a/resources/mandrill_132x130_6x5.astc b/resources/mandrill_132x130_6x5.astc
deleted file mode 100644 (file)
index a9f81e2..0000000
Binary files a/resources/mandrill_132x130_6x5.astc and /dev/null differ
diff --git a/resources/mandrill_132x132_12x12.astc b/resources/mandrill_132x132_12x12.astc
deleted file mode 100644 (file)
index 6b6346c..0000000
Binary files a/resources/mandrill_132x132_12x12.astc and /dev/null differ
diff --git a/resources/mandrill_132x132_6x6.astc b/resources/mandrill_132x132_6x6.astc
deleted file mode 100644 (file)
index 34f1c19..0000000
Binary files a/resources/mandrill_132x132_6x6.astc and /dev/null differ
diff --git a/resources/mandrill_512.pkm b/resources/mandrill_512.pkm
deleted file mode 100644 (file)
index 80baf98..0000000
Binary files a/resources/mandrill_512.pkm and /dev/null differ
index 0df14df..4a85217 100644 (file)
 #include "SkGrPriv.h"
 #endif
 
+// Until we actually have codecs/etc. that can contain/support a GPU texture format
+// skip this step, since for some generators, returning their encoded data as a SkData
+// can be somewhat expensive, and this call doesn't indicate to the generator that we're
+// only interested in GPU datas...
+// see skbug.com/ 4971, 5128, ...
+//#define SK_SUPPORT_COMPRESSED_TEXTURES_IN_CACHERATOR
+
 SkImageCacherator* SkImageCacherator::NewFromGenerator(SkImageGenerator* gen,
                                                        const SkIRect* subset) {
     if (!gen) {
@@ -195,6 +202,7 @@ bool SkImageCacherator::lockAsBitmap(SkBitmap* bitmap, const SkImage* client,
 
 #if SK_SUPPORT_GPU
 
+#ifdef SK_SUPPORT_COMPRESSED_TEXTURES_IN_CACHERATOR
 static GrTexture* load_compressed_into_texture(GrContext* ctx, SkData* data, GrSurfaceDesc desc) {
     const void* rawStart;
     GrPixelConfig config = GrIsCompressedTextureDataSupported(ctx, data, desc.fWidth, desc.fHeight,
@@ -206,6 +214,7 @@ static GrTexture* load_compressed_into_texture(GrContext* ctx, SkData* data, GrS
     desc.fConfig = config;
     return ctx->textureProvider()->createTexture(desc, SkBudgeted::kYes, rawStart, 0);
 }
+#endif
 
 class Generator_GrYUVProvider : public GrYUVProvider {
     SkImageGenerator* fGen;
@@ -276,6 +285,7 @@ GrTexture* SkImageCacherator::lockTexture(GrContext* ctx, const GrUniqueKey& key
 
     const GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(fInfo, *ctx->caps());
 
+#ifdef SK_SUPPORT_COMPRESSED_TEXTURES_IN_CACHERATOR
     // 3. Ask the generator to return a compressed form that the GPU might support
     SkAutoTUnref<SkData> data(this->refEncoded(ctx));
     if (data) {
@@ -286,6 +296,7 @@ GrTexture* SkImageCacherator::lockTexture(GrContext* ctx, const GrUniqueKey& key
             return set_key_and_return(tex, key);
         }
     }
+#endif
 
     // 4. Ask the generator to return YUV planes, which the GPU can convert
     {