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

Unified Diff: include/core/SkImage.h

Issue 24130009: promote SkImage::AlphaType to SkAlphaType (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 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/SkAlpha.h ('k') | include/core/SkSurface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « include/core/SkAlpha.h ('k') | include/core/SkSurface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698