Index: src/gpu/SkGr.cpp |
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp |
index fa9fa713269f87d0f7766c6f93e1b8179af4bd30..c053e8b81102e796ceb4b3442c85269021730d3c 100644 |
--- a/src/gpu/SkGr.cpp |
+++ b/src/gpu/SkGr.cpp |
@@ -260,6 +260,29 @@ GrPixelConfig SkBitmapConfig2GrPixelConfig(SkBitmap::Config config) { |
} |
} |
+// alphatype is ignore for now, but if GrPixelConfig is expanded to encompass |
+// alpha info, that will be considered. |
+GrPixelConfig SkImageInfo2GrPixelConfig(SkColorType ct, SkAlphaType) { |
+ switch (ct) { |
+ case kUnknown_SkColorType: |
+ return kUnknown_GrPixelConfig; |
+ case kAlpha_8_SkColorType: |
+ return kAlpha_8_GrPixelConfig; |
+ case kRGB_565_SkColorType: |
+ return kRGB_565_GrPixelConfig; |
+ case kARGB_4444_SkColorType: |
+ return kRGBA_4444_GrPixelConfig; |
+ case kRGBA_8888_SkColorType: |
+ return kRGBA_8888_GrPixelConfig; |
+ case kBGRA_8888_SkColorType: |
+ return kBGRA_8888_GrPixelConfig; |
+ case kIndex_8_SkColorType: |
+ return kIndex_8_GrPixelConfig; |
+ } |
+ SkASSERT(0); // shouldn't get here |
+ return kUnknown_GrPixelConfig; |
+} |
+ |
bool GrPixelConfig2ColorType(GrPixelConfig config, SkColorType* ctOut) { |
SkColorType ct; |
switch (config) { |