aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu/GrTypes.h
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-01-31 19:27:53 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-31 19:27:53 -0800
commit6c96672491b04cb782bce8fee778124df66524a0 (patch)
tree49407e533766dad8d3fae3c5794afc4536a79098 /include/gpu/GrTypes.h
parent0b737c52a7b8bc6ba41d309e88b3f7e995746f8d (diff)
Move npot resizing out of GrContext and simplify GrContext texture functions.
Diffstat (limited to 'include/gpu/GrTypes.h')
-rw-r--r--include/gpu/GrTypes.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h
index f4fb3ab43f..7532984ebe 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) {