Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Unified Diff: src/gpu/GrDrawTarget.cpp

Issue 304743004: Move ETC1 and LATC enums value to GrPixelConfig (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add LATC checks Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrDrawTarget.cpp
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index b35865c2641509907f241a71098cf8a293a5b4b8..526d9b6c5486e1c878f376e374a0c1290fb94702 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -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;
}
@@ -1112,6 +1109,8 @@ SkString GrDrawTargetCaps::dump() const {
"RGBA444", // kRGBA_4444_GrPixelConfig,
"RGBA8888", // kRGBA_8888_GrPixelConfig,
"BGRA8888", // kBGRA_8888_GrPixelConfig,
+ "ETC1", // kETC1_GrPixelConfig,
+ "LATC", // kLATC_GrPixelConfig,
};
GR_STATIC_ASSERT(0 == kUnknown_GrPixelConfig);
GR_STATIC_ASSERT(1 == kAlpha_8_GrPixelConfig);
@@ -1120,6 +1119,8 @@ SkString GrDrawTargetCaps::dump() const {
GR_STATIC_ASSERT(4 == kRGBA_4444_GrPixelConfig);
GR_STATIC_ASSERT(5 == kRGBA_8888_GrPixelConfig);
GR_STATIC_ASSERT(6 == kBGRA_8888_GrPixelConfig);
+ GR_STATIC_ASSERT(7 == kETC1_GrPixelConfig);
+ GR_STATIC_ASSERT(8 == kLATC_GrPixelConfig);
GR_STATIC_ASSERT(SK_ARRAY_COUNT(kConfigNames) == kGrPixelConfigCnt);
SkASSERT(!fConfigRenderSupport[kUnknown_GrPixelConfig][0]);
@@ -1133,21 +1134,5 @@ SkString GrDrawTargetCaps::dump() const {
}
}
- static const char* kCompressedFormatNames[] = {
- "ETC1", // kETC1_GrCompressedFormat
- "ETC2", // kETC2_GrCompressedFormat,
- "DXT1", // kDXT1_GrCompressedFormat,
- };
- GR_STATIC_ASSERT(0 == kETC1_GrCompressedFormat);
- GR_STATIC_ASSERT(1 == kETC2_GrCompressedFormat);
- GR_STATIC_ASSERT(2 == kDXT1_GrCompressedFormat);
- GR_STATIC_ASSERT(SK_ARRAY_COUNT(kCompressedFormatNames) == kGrCompressedFormatCount);
-
- for (size_t i = 0; i < SK_ARRAY_COUNT(kCompressedFormatNames); ++i) {
- r.appendf("%s Compressed Texture Support: %s\n",
- kCompressedFormatNames[i],
- gNY[fCompressedFormatSupport[i]]);
- }
-
return r;
}

Powered by Google App Engine
This is Rietveld 408576698