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

Side by Side Diff: src/codec/SkWbmpCodec.cpp

Issue 1907593004: Support the non-native (RGBA/BGRA) swizzle (Closed) Base URL: https://skia.googlesource.com/skia.git@tryagain
Patch Set: Multiple bug fixes Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « src/codec/SkSwizzler.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/codec/SkSwizzler.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698