| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 #include "SkCodec.h" | 8 #include "SkCodec.h" |
| 9 #include "SkCodecPriv.h" | 9 #include "SkCodecPriv.h" |
| 10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 SkPMColor* colorPtr, int* colorCount) { | 25 SkPMColor* colorPtr, int* colorCount) { |
| 26 if (kIndex_8_SkColorType == colorType) { | 26 if (kIndex_8_SkColorType == colorType) { |
| 27 colorPtr[0] = SK_ColorBLACK; | 27 colorPtr[0] = SK_ColorBLACK; |
| 28 colorPtr[1] = SK_ColorWHITE; | 28 colorPtr[1] = SK_ColorWHITE; |
| 29 *colorCount = 2; | 29 *colorCount = 2; |
| 30 } | 30 } |
| 31 } | 31 } |
| 32 | 32 |
| 33 static inline bool valid_color_type(SkColorType colorType, SkAlphaType alphaType
) { | 33 static inline bool valid_color_type(SkColorType colorType, SkAlphaType alphaType
) { |
| 34 switch (colorType) { | 34 switch (colorType) { |
| 35 case kN32_SkColorType: | 35 case kRGBA_8888_SkColorType: |
| 36 case kBGRA_8888_SkColorType: |
| 36 case kIndex_8_SkColorType: | 37 case kIndex_8_SkColorType: |
| 37 return true; | 38 return true; |
| 38 case kGray_8_SkColorType: | 39 case kGray_8_SkColorType: |
| 39 case kRGB_565_SkColorType: | 40 case kRGB_565_SkColorType: |
| 40 return kOpaque_SkAlphaType == alphaType; | 41 return kOpaque_SkAlphaType == alphaType; |
| 41 default: | 42 default: |
| 42 return false; | 43 return false; |
| 43 } | 44 } |
| 44 } | 45 } |
| 45 | 46 |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 } | 210 } |
| 210 | 211 |
| 211 // Initialize the swizzler | 212 // Initialize the swizzler |
| 212 fSwizzler.reset(this->initializeSwizzler(dstInfo, get_color_ptr(fColorTable.
get()), options)); | 213 fSwizzler.reset(this->initializeSwizzler(dstInfo, get_color_ptr(fColorTable.
get()), options)); |
| 213 SkASSERT(fSwizzler); | 214 SkASSERT(fSwizzler); |
| 214 | 215 |
| 215 fSrcBuffer.reset(fSrcRowBytes); | 216 fSrcBuffer.reset(fSrcRowBytes); |
| 216 | 217 |
| 217 return kSuccess; | 218 return kSuccess; |
| 218 } | 219 } |
| OLD | NEW |