Revert of Added test for non cached ETC1 (patchset #2 id:20001 of https://codereview.chromium.org/564493002/)
Reason for revert:
This is causing dm and gm to crash on the Win8 7770 bots, for example
http://108.170.220.120:10117/builders/Test-Win8-ShuttleA-HD7770-x86-Debug/builds/2128
An example stack trace looks like
[13:46:16.260000] -1M drawing... extractbitmap [600 600]
[13:46:16.760000] -1M drawing... etc1bitmap_npot [124 124]
[13:46:16.760000] -1M drawing... etc1bitmap_r11.ktx [128 128]
[13:46:16.760000] -1M drawing... etc1bitmap_ktx [128 128]
[13:46:16.760000] -1M drawing... etc1bitmap_pkm_volatile [128 128]
[13:46:16.760000]
[13:46:16.760000] Caught exception 3221225477 EXCEPTION_ACCESS_VIOLATION
[13:46:16.760000] sk_gr_allocate_texture +c9
[13:46:16.760000] load_etc1_texture +1dd
[13:46:16.760000] sk_gr_create_bitmap_texture +199
[13:46:16.760000] GrLockAndRefCachedBitmapTexture +ad
[13:46:16.760000] SkGpuDevice::SkAutoCachedTexture::set +5d
[13:46:16.760000] SkGpuDevice::SkAutoCachedTexture::SkAutoCachedTexture +65
[13:46:16.760000] SkGpuDevice::internalDrawBitmap +8e
[13:46:16.760000] SkGpuDevice::drawBitmapCommon +608
[13:46:16.760000] SkGpuDevice::drawBitmap +79
[13:46:16.760000] SkCanvas::internalDrawBitmap +11b
[13:46:16.760000] SkCanvas::drawBitmap +d3
[13:46:16.760000] skiagm::ETC1BitmapGM::onDraw +140
[13:46:16.760000] skiagm::GM::drawContent +3c
[13:46:16.760000] skiagm::GM::draw +24
[13:46:16.760000] GMMain::invokeGM +63
[13:46:16.760000] GMMain::generate_image +186
[13:46:16.760000] GMMain::test_drawing +5b
[13:46:16.760000] run_multiple_configs +2f9
[13:46:16.760000] tool_main +75d
[13:46:16.760000] main +16
[13:46:16.760000] __tmainCRTStartup +199
[13:46:16.760000] mainCRTStartup +d
[13:46:16.760000] BaseThreadInitThunk +e
[13:46:16.760000] RtlInitializeExceptionChain +84
[13:46:16.760000] RtlInitializeExceptionChain +5a
Original issue's description:
> Added test for non cached ETC1
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/d9ec549071581d9d1dc2e5fac3163305ae935a39
R=bsalomon@chromium.org, robertphillips@chromium.org, robertphillips@google.com, sugoi@chromium.org
TBR=bsalomon@chromium.org, robertphillips@chromium.org, robertphillips@google.com, sugoi@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Author: bungeman@google.com
Review URL: https://codereview.chromium.org/559093003
diff --git a/gm/etc1bitmap.cpp b/gm/etc1bitmap.cpp
index 2782705..fcf521a 100644
--- a/gm/etc1bitmap.cpp
+++ b/gm/etc1bitmap.cpp
@@ -84,9 +84,6 @@
virtual SkString onShortName() SK_OVERRIDE {
SkString str = SkString("etc1bitmap_");
str.append(this->fileExtension());
- if (this->isVolatile()) {
- str.append("_volatile");
- }
return str;
}
@@ -94,8 +91,6 @@
return SkISize::Make(128, 128);
}
- virtual bool isVolatile() const { return false; }
-
virtual SkString fileExtension() const = 0;
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
@@ -115,8 +110,6 @@
return;
}
- bm.setIsVolatile(this->isVolatile());
-
canvas->drawBitmap(bm, 0, 0);
}
@@ -138,21 +131,6 @@
typedef ETC1BitmapGM INHERITED;
};
-// This class specializes ETC1BitmapGM to load the mandrill_128.pkm file in a volatile bitmap.
-class ETC1Bitmap_PKM_VOLATILE_GM : public ETC1BitmapGM {
-public:
- ETC1Bitmap_PKM_VOLATILE_GM() : ETC1BitmapGM() { }
- virtual ~ETC1Bitmap_PKM_VOLATILE_GM() { }
-
-protected:
-
- virtual SkString fileExtension() const SK_OVERRIDE { return SkString("pkm"); }
- virtual bool isVolatile() const SK_OVERRIDE { return true; }
-
-private:
- typedef ETC1BitmapGM INHERITED;
-};
-
// This class specializes ETC1BitmapGM to load the mandrill_128.ktx file.
class ETC1Bitmap_KTX_GM : public ETC1BitmapGM {
public:
@@ -246,7 +224,6 @@
//////////////////////////////////////////////////////////////////////////////
DEF_GM( return SkNEW(skiagm::ETC1Bitmap_PKM_GM); )
-DEF_GM( return SkNEW(skiagm::ETC1Bitmap_PKM_VOLATILE_GM); )
DEF_GM( return SkNEW(skiagm::ETC1Bitmap_KTX_GM); )
DEF_GM( return SkNEW(skiagm::ETC1Bitmap_R11_KTX_GM); )
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index cdbdc41..73773b0 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -139,7 +139,7 @@
bool cache,
const GrTextureParams* params,
const SkBitmap& bm,
- const GrTextureDesc& desc,
+ GrTextureDesc desc,
const void* pixels,
size_t rowBytes) {
GrTexture* result;
@@ -322,9 +322,12 @@
// Is this an ETC1 encoded texture?
#ifndef SK_IGNORE_ETC1_SUPPORT
else if (
+ // We do not support scratch ETC1 textures, hence they should all be at least
+ // trying to go to the cache.
+ cache
// Make sure that the underlying device supports ETC1 textures before we go ahead
// and check the data.
- ctx->getGpu()->caps()->isConfigTexturable(kETC1_GrPixelConfig)
+ && ctx->getGpu()->caps()->isConfigTexturable(kETC1_GrPixelConfig)
// If the bitmap had compressed data and was then uncompressed, it'll still return
// compressed data on 'refEncodedData' and upload it. Probably not good, since if
// the bitmap has available pixels, then they might not be what the decompressed