OLD | NEW |
1 | |
2 /* | 1 /* |
3 * Copyright 2010 Google Inc. | 2 * Copyright 2010 Google Inc. |
4 * | 3 * |
5 * 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 |
6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
7 */ | 6 */ |
8 | 7 |
9 | |
10 | |
11 #include "SkGr.h" | 8 #include "SkGr.h" |
12 | 9 |
13 /* Fill out buffer with the compressed format Ganesh expects from a colortable | 10 /* Fill out buffer with the compressed format Ganesh expects from a colortable |
14 based bitmap. [palette (colortable) + indices]. | 11 based bitmap. [palette (colortable) + indices]. |
15 | 12 |
16 At the moment Ganesh only supports 8bit version. If Ganesh allowed we others | 13 At the moment Ganesh only supports 8bit version. If Ganesh allowed we others |
17 we could detect that the colortable.count is <= 16, and then repack the | 14 we could detect that the colortable.count is <= 16, and then repack the |
18 indices as nibbles to save RAM, but it would take more time (i.e. a lot | 15 indices as nibbles to save RAM, but it would take more time (i.e. a lot |
19 slower than memcpy), so skipping that for now. | 16 slower than memcpy), so skipping that for now. |
20 | 17 |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 return kAlpha_8_GrPixelConfig; | 203 return kAlpha_8_GrPixelConfig; |
207 case SkBitmap::kIndex8_Config: | 204 case SkBitmap::kIndex8_Config: |
208 return kIndex_8_GrPixelConfig; | 205 return kIndex_8_GrPixelConfig; |
209 case SkBitmap::kRGB_565_Config: | 206 case SkBitmap::kRGB_565_Config: |
210 return kRGB_565_GrPixelConfig; | 207 return kRGB_565_GrPixelConfig; |
211 case SkBitmap::kARGB_4444_Config: | 208 case SkBitmap::kARGB_4444_Config: |
212 return kRGBA_4444_GrPixelConfig; | 209 return kRGBA_4444_GrPixelConfig; |
213 case SkBitmap::kARGB_8888_Config: | 210 case SkBitmap::kARGB_8888_Config: |
214 return kSkia8888_GrPixelConfig; | 211 return kSkia8888_GrPixelConfig; |
215 default: | 212 default: |
216 // kNo_Config, kA1_Config missing, and kRLE_Index8_Config | 213 // kNo_Config, kA1_Config missing |
217 return kUnknown_GrPixelConfig; | 214 return kUnknown_GrPixelConfig; |
218 } | 215 } |
219 } | 216 } |
OLD | NEW |