Index: include/core/SkImage.h |
diff --git a/include/core/SkImage.h b/include/core/SkImage.h |
index 871d4612c72fde51bdc3eda36e4d90824ec71a52..f6f6a41eaf1f505aa326ef7222fa32997c6a64af 100644 |
--- a/include/core/SkImage.h |
+++ b/include/core/SkImage.h |
@@ -8,6 +8,7 @@ |
#ifndef SkImage_DEFINED |
#define SkImage_DEFINED |
+#include "SkAlpha.h" |
#include "SkImageEncoder.h" |
#include "SkRefCnt.h" |
#include "SkScalar.h" |
@@ -41,25 +42,32 @@ public: |
kRGB_565_ColorType, |
kRGBA_8888_ColorType, |
kBGRA_8888_ColorType, |
- kPMColor_ColorType, |
+ |
+#if SK_PMCOLOR_BYTE_ORDER(B,G,R,A) |
+ kPMColor_ColorType = kBGRA_8888_ColorType, |
+#elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A) |
+ kPMColor_ColorType = kRGBA_8888_ColorType, |
+#else |
+ #error "SK_*32_SHFIT values must correspond to BGRA or RGBA byte order |
+#endif |
- kLastEnum_ColorType = kPMColor_ColorType |
+ kLastEnum_ColorType = kBGRA_8888_ColorType |
}; |
+#ifdef SK_ENABLE_LEGACY_API_ALIASING |
enum AlphaType { |
- kIgnore_AlphaType, |
- kOpaque_AlphaType, |
- kPremul_AlphaType, |
- kUnpremul_AlphaType, |
- |
- kLastEnum_AlphaType = kUnpremul_AlphaType |
+ kIgnore_AlphaType = kIgnore_SkAlphaType, |
+ kOpaque_AlphaType = kOpaque_SkAlphaType, |
+ kPremul_AlphaType = kPremul_SkAlphaType, |
+ kUnpremul_AlphaType = kUnpremul_SkAlphaType, |
}; |
+#endif |
struct Info { |
int fWidth; |
int fHeight; |
ColorType fColorType; |
- AlphaType fAlphaType; |
+ SkAlphaType fAlphaType; |
}; |
static SkImage* NewRasterCopy(const Info&, const void* pixels, size_t rowBytes); |