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

Unified Diff: include/core/SkImageInfo.h

Issue 966853002: Revert of Revert of replace kIgnore_SkAlphaType with kUnknown_SkAlphaType (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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/SkCanvas.h ('k') | src/core/SkBitmap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkImageInfo.h
diff --git a/include/core/SkImageInfo.h b/include/core/SkImageInfo.h
index f928416fe7bd1c9df84ef431ee13229f35c184d1..d915c09255f345abe86d419153ba96c7a52360a2 100644
--- a/include/core/SkImageInfo.h
+++ b/include/core/SkImageInfo.h
@@ -19,12 +19,7 @@
* Describes how to interpret the alpha compoent of a pixel.
*/
enum SkAlphaType {
- /**
- * All pixels should be treated as opaque, regardless of the value stored
- * in their alpha field. Used for legacy images that wrote 0 or garbarge
- * in their alpha field, but intended the RGB to be treated as opaque.
- */
- kIgnore_SkAlphaType,
+ kUnknown_SkAlphaType,
/**
* All pixels are stored as opaque. This differs slightly from kIgnore in
@@ -53,11 +48,7 @@
};
static inline bool SkAlphaTypeIsOpaque(SkAlphaType at) {
- SK_COMPILE_ASSERT(kIgnore_SkAlphaType < kOpaque_SkAlphaType, bad_alphatype_order);
- SK_COMPILE_ASSERT(kPremul_SkAlphaType > kOpaque_SkAlphaType, bad_alphatype_order);
- SK_COMPILE_ASSERT(kUnpremul_SkAlphaType > kOpaque_SkAlphaType, bad_alphatype_order);
-
- return (unsigned)at <= kOpaque_SkAlphaType;
+ return kOpaque_SkAlphaType == at;
}
static inline bool SkAlphaTypeIsValid(unsigned value) {
@@ -161,7 +152,7 @@
: fWidth(0)
, fHeight(0)
, fColorType(kUnknown_SkColorType)
- , fAlphaType(kIgnore_SkAlphaType)
+ , fAlphaType(kUnknown_SkAlphaType)
, fProfileType(kLinear_SkColorProfileType)
{}
@@ -200,7 +191,7 @@
}
static SkImageInfo MakeUnknown(int width, int height) {
- return SkImageInfo(width, height, kUnknown_SkColorType, kIgnore_SkAlphaType,
+ return SkImageInfo(width, height, kUnknown_SkColorType, kUnknown_SkAlphaType,
kLinear_SkColorProfileType);
}
« no previous file with comments | « include/core/SkCanvas.h ('k') | src/core/SkBitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698