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

Unified Diff: src/gpu/GrSWMaskHelper.cpp

Issue 447343002: Revert of - Add astcbitmap to gm slides (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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
« no previous file with comments | « include/core/SkImageDecoder.h ('k') | src/images/SkForceLinking.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrSWMaskHelper.cpp
diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp
index a98343550896a74c1e292ab7041a357204b56cd8..744fa1db8ffff2b192d63a2134927630cbed18a0 100644
--- a/src/gpu/GrSWMaskHelper.cpp
+++ b/src/gpu/GrSWMaskHelper.cpp
@@ -37,33 +37,19 @@
}
static inline GrPixelConfig fmt_to_config(SkTextureCompressor::Format fmt) {
-
- GrPixelConfig config;
- switch (fmt) {
- case SkTextureCompressor::kLATC_Format:
- config = kLATC_GrPixelConfig;
- break;
-
- case SkTextureCompressor::kR11_EAC_Format:
- config = kR11_EAC_GrPixelConfig;
- break;
-
- case SkTextureCompressor::kASTC_12x12_Format:
- config = kASTC_12x12_GrPixelConfig;
- break;
-
- case SkTextureCompressor::kETC1_Format:
- config = kETC1_GrPixelConfig;
- break;
-
- default:
- SkDEBUGFAIL("No GrPixelConfig for compression format!");
- // Best guess
- config = kAlpha_8_GrPixelConfig;
- break;
- }
-
- return config;
+ static const GrPixelConfig configMap[] = {
+ kLATC_GrPixelConfig, // kLATC_Format,
+ kR11_EAC_GrPixelConfig, // kR11_EAC_Format,
+ kETC1_GrPixelConfig, // kETC1_Format,
+ kASTC_12x12_GrPixelConfig // kASTC_12x12_Format,
+ };
+ GR_STATIC_ASSERT(0 == SkTextureCompressor::kLATC_Format);
+ GR_STATIC_ASSERT(1 == SkTextureCompressor::kR11_EAC_Format);
+ GR_STATIC_ASSERT(2 == SkTextureCompressor::kETC1_Format);
+ GR_STATIC_ASSERT(3 == SkTextureCompressor::kASTC_12x12_Format);
+ GR_STATIC_ASSERT(SK_ARRAY_COUNT(configMap) == SkTextureCompressor::kFormatCnt);
+
+ return configMap[fmt];
}
#if GR_COMPRESS_ALPHA_MASK
« no previous file with comments | « include/core/SkImageDecoder.h ('k') | src/images/SkForceLinking.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698