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

Unified Diff: include/gpu/GrTypes.h

Issue 882223003: Move npot resizing out of GrContext and simplify GrContext texture functions. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 11 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/gpu/GrResourceKey.h ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrTypes.h
diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h
index f4fb3ab43f3acb30f1ecbb8b2b2174bc6ed224fb..7532984ebe73acda52df9518dc32901a47649108 100644
--- a/include/gpu/GrTypes.h
+++ b/include/gpu/GrTypes.h
@@ -302,6 +302,22 @@ static inline bool GrPixelConfigIsCompressed(GrPixelConfig config) {
}
}
+/** If the pixel config is compressed, return an equivalent uncompressed format. */
+static inline GrPixelConfig GrMakePixelConfigUncompressed(GrPixelConfig config) {
+ switch (config) {
+ case kIndex_8_GrPixelConfig:
+ case kETC1_GrPixelConfig:
+ case kASTC_12x12_GrPixelConfig:
+ return kRGBA_8888_GrPixelConfig;
+ case kLATC_GrPixelConfig:
+ case kR11_EAC_GrPixelConfig:
+ return kAlpha_8_GrPixelConfig;
+ default:
+ SkASSERT(!GrPixelConfigIsCompressed(config));
+ return config;
+ }
+}
+
// Returns true if the pixel config is 32 bits per pixel
static inline bool GrPixelConfigIs8888(GrPixelConfig config) {
switch (config) {
« no previous file with comments | « include/gpu/GrResourceKey.h ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698