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 "SkCodecPriv.h" | 8 #include "SkCodecPriv.h" |
9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
10 #include "SkSwizzler.h" | 10 #include "SkSwizzler.h" |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 break; | 463 break; |
464 case kGray_8_SkColorType: | 464 case kGray_8_SkColorType: |
465 // If the destination is kGray, the caller passes in an 8-bit color. | 465 // If the destination is kGray, the caller passes in an 8-bit color. |
466 // We will not assert that the high bits of colorOrIndex must be zer
oed. | 466 // We will not assert that the high bits of colorOrIndex must be zer
oed. |
467 // This allows us to take advantage of the fact that the low 8 bits
of an | 467 // This allows us to take advantage of the fact that the low 8 bits
of an |
468 // SKPMColor may be a valid a grayscale color. For example, the low
8 | 468 // SKPMColor may be a valid a grayscale color. For example, the low
8 |
469 // bits of SK_ColorBLACK are identical to the grayscale representati
on | 469 // bits of SK_ColorBLACK are identical to the grayscale representati
on |
470 // for black. | 470 // for black. |
471 memset(dstStartRow, (uint8_t) colorOrIndex, bytesToFill); | 471 memset(dstStartRow, (uint8_t) colorOrIndex, bytesToFill); |
472 break; | 472 break; |
| 473 case kRGB_565_SkColorType: |
| 474 // If the destination is k565, the caller passes in a 16-bit color. |
| 475 // We will not assert that the high bits of colorOrIndex must be zer
oed. |
| 476 // This allows us to take advantage of the fact that the low 16 bits
of an |
| 477 // SKPMColor may be a valid a 565 color. For example, the low 16 |
| 478 // bits of SK_ColorBLACK are identical to the 565 representation |
| 479 // for black. |
| 480 memset(dstStartRow, (uint16_t) colorOrIndex, bytesToFill); |
| 481 break; |
473 default: | 482 default: |
474 SkCodecPrintf("Error: Unsupported dst color type for fill(). Doing
nothing.\n"); | 483 SkCodecPrintf("Error: Unsupported dst color type for fill(). Doing
nothing.\n"); |
475 SkASSERT(false); | 484 SkASSERT(false); |
476 break; | 485 break; |
477 } | 486 } |
478 } | 487 } |
OLD | NEW |