Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkImageInfo_DEFINED | 8 #ifndef SkImageInfo_DEFINED |
| 9 #define SkImageInfo_DEFINED | 9 #define SkImageInfo_DEFINED |
| 10 | 10 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 72 kUnknown_SkColorType, | 72 kUnknown_SkColorType, |
| 73 kAlpha_8_SkColorType, | 73 kAlpha_8_SkColorType, |
| 74 kRGB_565_SkColorType, | 74 kRGB_565_SkColorType, |
| 75 kARGB_4444_SkColorType, | 75 kARGB_4444_SkColorType, |
| 76 kRGBA_8888_SkColorType, | 76 kRGBA_8888_SkColorType, |
| 77 kBGRA_8888_SkColorType, | 77 kBGRA_8888_SkColorType, |
| 78 kIndex_8_SkColorType, | 78 kIndex_8_SkColorType, |
| 79 | 79 |
| 80 kLastEnum_SkColorType = kIndex_8_SkColorType, | 80 kLastEnum_SkColorType = kIndex_8_SkColorType, |
| 81 | 81 |
| 82 #if SK_PMCOLOR_BYTE_ORDER(B,G,R,A) | 82 #if SK_PMCOLOR_BYTE_ORDER(B,G,R,A) |
|
scroggo
2014/04/07 21:35:49
In theory we should change this as well. SK_N32_BY
| |
| 83 kPMColor_SkColorType = kBGRA_8888_SkColorType | 83 kN32_SkColorType = kBGRA_8888_SkColorType, |
|
scroggo
2014/04/07 21:35:49
I went with your suggesting here, but I'd be happy
| |
| 84 #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A) | 84 #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A) |
| 85 kPMColor_SkColorType = kRGBA_8888_SkColorType | 85 kN32_SkColorType = kRGBA_8888_SkColorType, |
| 86 #else | 86 #else |
| 87 #error "SK_*32_SHFIT values must correspond to BGRA or RGBA byte order" | 87 #error "SK_*32_SHFIT values must correspond to BGRA or RGBA byte order" |
| 88 #endif | 88 #endif |
| 89 | |
| 90 #ifdef SK_SUPPORT_LEGACY_N32_NAME | |
|
reed1
2014/04/08 13:04:57
I suggest we ...
1. don't add a guard until we ha
scroggo
2014/04/08 14:46:29
I 100% agree. I'd like to make the change in anoth
| |
| 91 kPMColor_SkColorType = kN32_SkColorType | |
| 92 #endif | |
| 89 }; | 93 }; |
| 90 | 94 |
| 91 static int SkColorTypeBytesPerPixel(SkColorType ct) { | 95 static int SkColorTypeBytesPerPixel(SkColorType ct) { |
| 92 static const uint8_t gSize[] = { | 96 static const uint8_t gSize[] = { |
| 93 0, // Unknown | 97 0, // Unknown |
| 94 1, // Alpha_8 | 98 1, // Alpha_8 |
| 95 2, // RGB_565 | 99 2, // RGB_565 |
| 96 2, // ARGB_4444 | 100 2, // ARGB_4444 |
| 97 4, // RGBA_8888 | 101 4, // RGBA_8888 |
| 98 4, // BGRA_8888 | 102 4, // BGRA_8888 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 220 | 224 |
| 221 bool validRowBytes(size_t rowBytes) const { | 225 bool validRowBytes(size_t rowBytes) const { |
| 222 uint64_t rb = sk_64_mul(fWidth, this->bytesPerPixel()); | 226 uint64_t rb = sk_64_mul(fWidth, this->bytesPerPixel()); |
| 223 return rowBytes >= rb; | 227 return rowBytes >= rb; |
| 224 } | 228 } |
| 225 | 229 |
| 226 SkDEBUGCODE(void validate() const;) | 230 SkDEBUGCODE(void validate() const;) |
| 227 }; | 231 }; |
| 228 | 232 |
| 229 #endif | 233 #endif |
| OLD | NEW |