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

Unified Diff: include/core/SkImageInfo.h

Issue 1666343002: add kRGBA_F16_SkColorType (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add unittest Created 4 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/SkColor.h ('k') | include/core/SkPixmap.h » ('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 4b82ae6e2fb317cf2414cb09801d72efc26de423..b2dda3f02178f2f2e241c92a06b683ddf4a9d15e 100644
--- a/include/core/SkImageInfo.h
+++ b/include/core/SkImageInfo.h
@@ -73,8 +73,9 @@ enum SkColorType {
kBGRA_8888_SkColorType,
kIndex_8_SkColorType,
kGray_8_SkColorType,
+ kRGBA_F16_SkColorType,
- kLastEnum_SkColorType = kGray_8_SkColorType,
+ kLastEnum_SkColorType = kRGBA_F16_SkColorType,
#if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
kN32_SkColorType = kBGRA_8888_SkColorType,
@@ -95,6 +96,7 @@ static int SkColorTypeBytesPerPixel(SkColorType ct) {
4, // BGRA_8888
1, // kIndex_8
1, // kGray_8
+ 8, // kRGBA_F16
};
static_assert(SK_ARRAY_COUNT(gSize) == (size_t)(kLastEnum_SkColorType + 1),
"size_mismatch_with_SkColorType_enum");
@@ -114,6 +116,7 @@ static inline bool SkColorTypeIsValid(unsigned value) {
static inline size_t SkColorTypeComputeOffset(SkColorType ct, int x, int y, size_t rowBytes) {
int shift = 0;
switch (SkColorTypeBytesPerPixel(ct)) {
+ case 8: shift = 3; break;
case 4: shift = 2; break;
case 2: shift = 1; break;
case 1: shift = 0; break;
« no previous file with comments | « include/core/SkColor.h ('k') | include/core/SkPixmap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698