Revert of Add compressed texture capabilities for GPU devices (https://codereview.chromium.org/292323003/)

Reason for revert:
Signeness comparison breaks build. After working some more, I think the API design will be cleaner without the Uncompressed enum, so I'm removing it and retesting everything.

Original issue's description:
> Add compressed texture capabilities for GPU devices
>
> BUG=skia:
>
> Committed: http://code.google.com/p/skia/source/detail?r=14880

R=bsalomon@google.com, robertphillips@google.com, halcanary@google.com
TBR=bsalomon@google.com, robertphillips@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Author: krajcevski@google.com

Review URL: https://codereview.chromium.org/296313003

git-svn-id: http://skia.googlecode.com/svn/trunk@14883 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
commit-bot@chromium.org 2014-05-23 20:40:26 +00:00
parent e5a8e66668
commit 5e565d1140
5 changed files with 0 additions and 69 deletions

View File

@ -619,19 +619,6 @@ enum GrGLBackendState {
kALL_GrGLBackendState = 0xffff
};
/**
* The compressed texture formats that may be supported by the renderer.
* Make sure to check for the required capabilities using
* GrDrawTargetCaps::compressedTextureSupport
*/
enum GrCompressedFormat {
kUncompressed_GrCompressedFormat = -1,
kETC1_GrCompressedFormat = 0,
kLast_GrCompressedFormat = kETC1_GrCompressedFormat
};
static const size_t kCompressedFormatCount = kLast_GrCompressedFormat + 1;
/**
* This value translates to reseting all the context state for any backend.
*/

View File

@ -1029,7 +1029,6 @@ void GrDrawTargetCaps::reset() {
fMaxSampleCount = 0;
memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport));
memset(fCompressedFormatSupport, 0, sizeof(fCompressedFormatSupport));
}
GrDrawTargetCaps& GrDrawTargetCaps::operator=(const GrDrawTargetCaps& other) {
@ -1055,8 +1054,6 @@ GrDrawTargetCaps& GrDrawTargetCaps::operator=(const GrDrawTargetCaps& other) {
fMaxSampleCount = other.fMaxSampleCount;
memcpy(fConfigRenderSupport, other.fConfigRenderSupport, sizeof(fConfigRenderSupport));
memcpy(fCompressedFormatSupport, other.fCompressedFormatSupport,
sizeof(fCompressedFormatSupport));
return *this;
}
@ -1132,18 +1129,5 @@ SkString GrDrawTargetCaps::dump() const {
gNY[fConfigRenderSupport[i][1]]);
}
}
static const char* kCompressedFormatNames[] = {
"ETC1", // kETC1_GrCompressedFormat
};
GR_STATIC_ASSERT(0 == kETC1_GrCompressedFormat);
GR_STATIC_ASSERT(SK_ARRAY_COUNT(kCompressedFormatNames) == kCompressedFormatCount);
for (size_t i = 0; i < kCompressedFormatCount; ++i) {
r.appendf("%s Compressed Texture Support: %s\n",
kCompressedFormatNames[i],
gNY[fCompressedFormatSupport[i]]);
}
return r;
}

View File

@ -72,11 +72,6 @@ public:
return fConfigRenderSupport[config][withMSAA];
}
bool compressedTextureSupport(GrCompressedFormat format) const {
SkASSERT(format < kCompressedFormatCount);
return fCompressedFormatSupport[format];
}
protected:
bool f8BitPaletteSupport : 1;
bool fNPOTTextureTileSupport : 1;
@ -102,8 +97,6 @@ protected:
// The first entry for each config is without msaa and the second is with.
bool fConfigRenderSupport[kGrPixelConfigCnt][2];
bool fCompressedFormatSupport[kCompressedFormatCount];
typedef SkRefCnt INHERITED;
};

View File

@ -369,8 +369,6 @@ bool GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) {
this->initConfigRenderableTable(ctxInfo);
this->initCompressedTextureSupport(ctxInfo);
return true;
}
@ -460,35 +458,6 @@ void GrGLCaps::initConfigRenderableTable(const GrGLContextInfo& ctxInfo) {
}
}
void GrGLCaps::initCompressedTextureSupport(const GrGLContextInfo &ctxInfo) {
GrGLStandard standard = ctxInfo.standard();
GrGLVersion version = ctxInfo.version();
// glCompressedTexImage2D is available on all OpenGL ES devices...
// however, it is only available on standard OpenGL after version 1.3
if (kGL_GrGLStandard == standard && version < GR_GL_VER(1, 3)) {
return;
}
// Check for ETC1
bool hasETC1 = false;
// First check version for support
if (kGL_GrGLStandard == standard) {
hasETC1 =
version >= GR_GL_VER(4, 3) ||
ctxInfo.hasExtension("GL_ARB_ES3_compatibility");
} else {
hasETC1 =
version >= GR_GL_VER(3, 0) ||
ctxInfo.hasExtension("GL_OES_compressed_ETC1_RGB8_texture") ||
// ETC2 is a superset of ETC1, so we can just check for that, too.
(ctxInfo.hasExtension("GL_OES_compressed_ETC2_RGB8_texture") &&
ctxInfo.hasExtension("GL_OES_compressed_ETC2_RGBA8_texture"));
}
fCompressedFormatSupport[kETC1_GrCompressedFormat] = hasETC1;
}
bool GrGLCaps::readPixelsSupported(const GrGLInterface* intf,
GrGLenum format,
GrGLenum type) const {

View File

@ -313,8 +313,6 @@ private:
// This must be called after initFSAASupport().
void initConfigRenderableTable(const GrGLContextInfo&);
void initCompressedTextureSupport(const GrGLContextInfo &);
// tracks configs that have been verified to pass the FBO completeness when
// used as a color attachment
VerifiedColorConfigs fVerifiedColorConfigs;